[Javascript] {} to []
Javascript Object to List {} : Object [] : List const a = {star:1, moon:2, sun:3} const b = Object.entries(a) console.log(b) //[["star",1] "moon",2], ["sun",3]] const c = Object.keys(a) console.log(c) //["star", "moon", "sun"] const d = Object.values(a) console.log(d) //[1, 2, 3]
2021. 4. 30.