How to find whether the particular array variable is empty or not in JavaScript? -



How to find whether the particular array variable is empty or not in JavaScript? -

i have array variable array[0], , need check whether array[0] contains value or not within of it. should do?

if have array , phone call eg. list, can check if has elements in next manner:

if (list.length){ // has elements (exactly list.length elements) } else { // not have elements }

see next details: documentation on length property of array objects in javascript

javascript

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -