Answer the question
In order to leave comments, you need to log in
Can't write data to js array. What's wrong?
Hello. Tell me please. I have an array of objects.
Each object has the following structure:
activity =
[ {
'@attributes': {
'Код': "1",
Наим: "Текст"
}
},
{
'@attributes': {
'Код': "2",
Наим: "Текст"
}
}
и т.д. ]
var code = [],
name = [];
for ( var i = 0; i < length; i ++) {
code.push(activity[0][ '@attributes'][ 'Код']);
name.push(activity[0][ '@attributes'][ 'Наим']);
}
Answer the question
In order to leave comments, you need to log in
Everything works fine prntscr.com/fe43sq
PS do not use Cyrillic in the keys
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question