var date = {
"1/2/20":500,
"2/2/20":601,
"3/2/20":702,
"4/2/20":803,
"5/2/20":904
}
How do I get only the number so it prints without the date like so:
500
601
702
803
904
var date = {
"1/2/20":500,
"2/2/20":601,
"3/2/20":702,
"4/2/20":803,
"5/2/20":904
}
How do I get only the number so it prints without the date like so:
500
601
702
803
904
You're looking for Object.values.
var date = {
"1/2/20":500,
"2/2/20":601,
"3/2/20":702,
"4/2/20":803,
"5/2/20":904
}
console.log(Object.values(date))
➜ ~ node foo.js
[ 500, 601, 702, 803, 904 ]
If you want to match output exactly add a call to join.
console.log(Object.values(date).join('\n'))
➜ ~ node foo.js
500
601
702
803
904