I have values like this
var npi = {
code1: 'sm1',
code2: 'sm8',
code3: 'sm9',
code4: ''
}
I want to push first 3 items into an array
var arr = [];
for (var i =0;i< 3;i++) {
arr.push(npi.code+''+i);
}
It says error npi.code is undefined since it is not considering npi.code1 instead npi.code.
Here i think its concat problem.Can anyone please suggest me help.Thanks.
npi.code0Youristarts from0npi['code'+i]Object.keys.