I am creating an array using Object.values()
. When comparing it to a hardcoded equivalent it returns false.
var newArr = Object.values({1: 50, 2: 50, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0});
console.log(newArr); // [50, 50, 0, 0, 0, 0, 0];
var compareArr = [50, 50, 0, 0, 0, 0, 0];
console.log(compareArr); // [50, 50, 0, 0, 0, 0, 0];
console.log(newArr === compareArr); // false
Am I missing something here or should it not return true?