How can I check JavaScript arrays for empty strings?

前端 未结 16 2053
面向向阳花
面向向阳花 2020-12-15 07:26

I need to check if array contains at least one empty elements. If any of the one element is empty then it will return false.

Example:

var my_arr = ne         


        
16条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-15 08:03

    You can try jQuery.inArray() function:

    return jQuery.inArray("", my_arr)
    

提交回复
热议问题