I have an array with multiple object into it,
const tokens =
[ { to: "abc", sound: "default" }
, { to: "def", sound: "ring" }
, { to: "ghi", sound: "vibrate" }
]
Further i want to add 2 different value say title and body to each object something like this :-
Note:- I have more than 300-400 objects in array "tokens" so please try to reply with an efficient code
const tokens =
[ { to: "abc", sound: "default", title: "test", body: "test2" }
, { to: "def", sound: "Ring", title: "test", body: "test2" }
, { to: "ghi", sound: "vibrate", title: "test", body: "test2" }
]
Please Let me know how this can be done in JavaScript ?