how to check an array is empty or not in reactjs code example Example: javascript how to check if array is empty if(array.length > 0)