I am working in node without angular or underscore and am looking for an efficient plain javascript answer (perhaps avoiding loops). I have the following array of JSON objects:
object = [
{account:2423, user:1564},
{account:1235, user:1564}
]
I want to add the following to each array within the object:
username:"clientname"
So that it looks like this in the end:
object = [
{account:2423, user:1564, username:"clientname"},
{account:1235, user:1564, username:"clientname"}
]
This question requests the avoidance of loops.