I want to add a value at first number of an object, but it's not adding at first number, How can I do this?
let obj = {'b': 2, 'c': 3, '3': 33, '4': 44};
const addNewValue = Object.assign({a: 1}, obj);
console.log(addNewValue);
Output should be as given below:-
{
"a": 1,
"3": 33,
"4": 44,
"b": 2,
"c": 3
}
But getting as given below:-
{
"3": 33,
"4": 44,
"a": 1,
"b": 2,
"c": 3
}