Passing in dynamic key:value pairs to an object literal? [duplicate]

EDIT: Use var obj = {}; obj[key] = chunks[i];

Because ECMAScript treats the key in this {key:1} as literal.

Leave a Comment