JavaScript Object Methods Cheat Sheet
Method / Operation Purpose Example
[Link](obj) Get all keys (property names) [Link]({a:1,b:2}) → ["a","b"]
[Link](obj) Get all values [Link]({a:1,b:2}) → [1,2]
[Link](obj) Get key/value pairs [Link]({a:1,b:2}) → [["a",1],["b",2]]
[Link](target, ...sources) Copy / merge properties [Link]({}, {a:1}, {b:2}) → {a:1,b:2}
[Link](obj) Make object fully immutable [Link](user)
[Link](obj) Prevent add/remove, but allow value edits [Link](car)
[Link](proto) Create new object inheriting from another [Link](parentObj)
[Link](obj, prop) Check if property exists directly on object [Link](user, "name") → true
[Link](prop) Legacy version of above (instance method) [Link]("name") → true
[Link](obj) Get all property names (even non-enumerable)
[Link](Math)
[Link](obj, prop, descriptor)Manually define a property (e.g., non-writable)[Link](obj,"id",{value:1})
[Link](arr) Convert [key,value] pairs → object [Link]([["a",1],["b",2]])
delete [Link] Remove a property from the object delete [Link]
[Link](obj) Get the prototype of an object [Link](child)
[Link](obj, proto) Set the prototype of an object [Link](child, parent)