for example I have an array like this:
var t = ko.observableArray([
{"FoodName":"Rice","FoodOften":"2"},
{"FoodName":"Apple","FoodOften":"3"}
]);
How can I add an static item to all of them like below in a smart way?
[
{"Student":"1","FoodName":"Rice","FoodOften":"2"},
{"Student":"1","FoodName":"Apple","FoodOften":"3"}
]
I know I can loop t().length to add t()[n].Student="1" but just wondering is there any smart way for knockout?