Method that returns one specific key of an object as string. Can be used to assign values as well.
const JDoe = {
name: 'John'
}
const foo = JDoe.name
JDoe.lastName = 'Doe'
Method that returns every key in an object as array. Can be used as an iterator.
const keys = Object.keys([objName])
keys.forEach((key) => {
// Do something with each key
})
Method that returns every value in an object as array. Used similarly to Object.keys()
const values = Object.values([objName])
values.forEach((value) => {
// Do something with each value
})
Method that returns every key & value in an object as array.
const entries = Object.entries([objName])
entries.forEach((entry) => {
// Do something with each entry
// entry[0] = key
// entry[1] = value
})
Assign one or more objects into one destination object.
Object.assign([destObj], [copyObj1], [copyObj2], ...)