Dictionary inside dictionary in javascript -
i have data sets. example, a,b , c. there sets of these values. example:-
[a:asd, b:ajs, c:aknd], [a:sdf, b:gss, c:fdss], [a:ijq, b:cba, c:jqwd]
etc.
now want make dictionary containing these values separate dictionaries. example:-
{ { a:asd, b:ajs, c:aknd }, { a:sdf, b:gss, c:fdss }, { a:ijq, b:cba, c:jqwd } }
can me out this. tried doing it's not making dictionary.
for( var i=0; i< n; i++) { data += { "a":value1, "b":value2, "c":value3 } }
any inputs?
this not make sense in javascript:
{ { a:asd, b:ajs, c:aknd }, { a:sdf, b:gss, c:fdss }, { a:ijq, b:cba, c:jqwd } }
if intend have object (dictionary) integer keys, so:
var data = {}; for( var i=0; i< n; i++) { data[i] = { "a":value1, "b":value2, "c":value3 } }
depending bit on you're trying do, array better choice:
var data = []; for( var i=0; i< n; i++) { data.push({ "a":value1, "b":value2, "c":value3 }); }
Comments
Post a Comment