I have an array of objects:
[{\"value\":\"14\",\"label\":\"7\"},{\"value\":\"14\",\"label\":\"7\"},{\"value\":\"18\",\"label\":\"7\"}]
How I ca
I would create a new array...
var original = [{"value":"14","label":"7"},{"value":"14","label":"7"},{"value":"18","label":"7"}]
var result = [];
for (var i = 0, l = original.length; i < l; i++) { // Traverse the whole array
var current = original[i];
if (! (current.value == 14 && current.label == 7) ) {
// It doesn't match the criteria, so add it to result
result.push( current );
}
}
Edit: I've read your question once more. You only want to remove the first element? Then use slice
to get only a part of the array.
var result = original.slice(1, original.length)
or splice
original.splice(0,1); // Remove one element from index 0.