I was just working with JavaScript objects and found this which i cant figure out . I created an array with few values and trying to convert that array into object using spread and new in JavaScript but for my surprise only the first value in the array is been put into the object with its type .
I have no need what exactly is happening in background
let array = [1970,1,1]
let object = new Object(array)
console.log(object)
Output :
Number {1970}
I was expecting {1970 , 1 , 1} object but actual output is Number {1970}