Hello i’m using map() jquery to create a new object array
DEMO but this code is not working
i need to have a new object array with the same name for all objects but with different number
so how can we point over each element in the old array and change its value , i used value[0].number but it didn’t do the trick
CODE
var x =[
{name : 'mark' , number : '10'},
{name : 'mina' , number : '15' } ,
];
var newObject = $.map(x,function(value,index){
value.name = 'mon';
value[0].number = 12 ;
value[1].number = 11 ;
return value ;
});
console.log(newObject) ;
Question is how can i point to each number in the old object array and change it
The old object is still here and is still called
x