How to remove row in 2d array in javascript

后端 未结 6 1660
醉梦人生
醉梦人生 2021-02-05 19:42

How to remove row in two dimensional array in JavaScript with row number. If I want to delete all elements in row number 4 then how can do it??

6条回答
  •  醉酒成梦
    2021-02-05 20:14

    delete array[index]; array.length--;

    In your case give index as 4 and execute the above statement and you need to manually reduce the length of array.

提交回复
热议问题