Is there a way to add the same item val="4" to each object of array in JavaScript?
Let's say there is
var arr = [{"num":"111"},{"ttt":"123","rss":"456"},...];
I'd like to get
arr2 = [{"num":"111", "val":"4"},{"ttt":"123", "rss":"456", "val":"4"},...];
Is it possible to make in one line with kind of .push()
to array or something similar?