July 22, 2017

Assigning primitives of an object

let v = "st";

let obj = Object.assign({}, v);
// obj = { '0': 's', '1': 't'}
// obj['1'] = 't'