Empty arrays seem to equal true and false at the same time

前端 未结 9 2261
别跟我提以往
别跟我提以往 2020-11-22 10:23

Empty arrays are true but they\'re also equal to false.

9条回答
  •  醉梦人生
    2020-11-22 10:57

    You can empty a JavaScript Array by referencing it to a new array, using list = [] or deleting the elements of the currently referenced array list.length = 0.

    Source: JavaScript Empty Array

提交回复
热议问题