92
rated 0 times
[
94]
[
2]
/ answers: 1 / hits: 77670
/ 13 Years ago, tue, february 7, 2012, 12:00:00
var arr = [{
key: key1, value: z
}, {
key: key2, value: u
}, {
...
}];
How to check whether my key:key1
exists already or not. If it does not exist, i need to add the key in ma array.
if(arr.hasOwnProperty(key1)){
arr.unshift({key:key1, value:z});
}
More From » javascript