javascript - Concat objects? -
this question has answer here:
- concat json objects 8 answers
- how can merge properties of 2 javascript objects dynamically? 53 answers
i have 2 objects same structure , want concat them using javascript. there easy way this?
var num = { '0': 0, '1': 0, '2': 0, '3': 0 }; var let = { 'a':'1', 'b':'2', 'c':'3' }
you can use jquery's .extend()
:
$.extend(num,let); // num merged object.
note: every duplicate index have value had in let
Comments
Post a Comment