Je reçois l'erreur suivante pour la troisième ligne:tableau méthode push ne fonctionne pas correctement
Can not set property accountName of Undefined
Quelqu'un peut-il aider?
var temp = [];
temp.accountId = newData.Account.Id;
temp.accountType = newData.Account.Type;
temp.accountholder.accountName = newData.Account.Name;
finaloutput.push(temp);
Vous montrez un comportement intéressant en Javascript avec ceci. Mais je ne sais pas si vous définissez 'temp.accountholder' explicitement avant ?;) – loveNoHate
finaloutput array a accountholder – user3421352
' temp.accountholder' est indéfini. Faites-le pas indéfini et vous n'aurez pas ce problème. –