Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript check if length is greater than 0

/*
 * To check if a number is greater than another number,
 * use the > (greater than) operator. Both strings and
 * arrays have a length property which you can access
 * using dot notation.
 */
string_or_array.length > 0;

"Hello world!".length > 5; // -> true
[ 1, 2, 3, 4, 5 ].length > 10; // -> false
[ 1, 2, 3, 4, 5 ].length > 5; // -> false
 
PREVIOUS NEXT
Tagged: #javascript #check #length #greater
ADD COMMENT
Topic
Name
7+7 =