Assigning primitives of an object

July 22, 2017

let v = 'st'

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

Tagged withobject, javascript

Questions, Comments, Suggestions? Open an Issue