Friday, 31 July 2015

js array, remove item from array, clear array



remove one item:

this.splice(this.indexOf(value), 1);

clear the array:

A.splice(0,A.length)


http://stackoverflow.com/questions/1232040/how-to-empty-an-array-in-javascript
http://www.w3schools.com/jsref/jsref_splice.asp

http://stackoverflow.com/questions/7142890/javascript-remove-an-array-item-by-value

No comments:

Post a comment