Keys, Values & Membership
Last updated
Read the contents of an object. None of these mutate.
.getKeys() → arrayThe object's keys.
.getValues() → arrayThe object's values.
.getEntries() → arrayThe object as an array of [key, value] pairs.
.contains(key) → booleanWhether the object has the given key.
object o = { a: 1, b: 2 }
log o.getKeys() // ["a", "b"]
log o.getValues() // [1, 2]
log o.getEntries() // [["a", 1], ["b", 2]]
log o.contains("a") // trueRead a single value with index syntax (
o["a"]oro.a) or.item(key). The inverse of.getEntries()is the array method.toEntriesObj().
Last updated