About the deleted array of js

var array = [
    {
        id:1,
        name:""
    },
    {
        id:2,
        name:""
    },
    {
        id:3,
        name:""
    }
];
array.splice(0,1);
array.splice(1,1);
console.log(array);

"" spliceN

change the function
this is obviously a search / filter operation

array.filter((item)=>item.name==="")

Array.prototype.splice.apply(array,[0,1],1);

can you first extract Xiao Hong into an array, then empty the original number, and then assign the new array to the original


array = [array [1]] the easiest


use the filter function

array.filter(item => item.id === 2)

look at your description, which means "I need a filter".


var array1 = array.slice (1) can bring out Xiao Hong

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3bf21-2c301.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3bf21-2c301.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?