underscore.js - How to remove a particular value from an array in Node.js -
i have array of values
var test =[]; test [1] = [ {"myself":true,chat_user:11,"message":"hi"}, {"myself":true,chat_user:11,"message":"evida"}, {"myself":false,chat_user:11,"message":"yes"}, ] test [6] = [ {"myself":true,chat_user:13,"message":"hi"}, {"myself":true,chat_user:13,"message":"evida"}, {"myself":false,chat_user:13,"message":"yes"}, ] test [9] = [ {"myself":true,chat_user:22,"message":"hi"}, {"myself":true,chat_user:22,"message":"evida"}, {"myself":false,chat_user:22,"message":"yes"}, ]
now have remove entry test[6] , need remaining array
ie
test [1] = [ {"myself":true,chat_user:11,"message":"hi"}, {"myself":true,chat_user:11,"message":"evida"}, {"myself":false,chat_user:11,"message":"yes"}, ] test [9] = [ {"myself":true,chat_user:22,"message":"hi"}, {"myself":true,chat_user:22,"message":"evida"}, {"myself":false,chat_user:22,"message":"yes"}, ]
is there function in node js, getting ?
thanks in advance
i'd suggest use:
delete test[6]
Comments
Post a Comment