Object static methods

Object.keys()

Try the free JavaScript compiler

Returns an array of enumerable own string keys. Excludes symbols, inherited properties and non-enumerable properties. Null and undefined throw TypeError.

Formal Syntax & Structure

javascript syntaxjavascript
Object.keys(object)

Parameters & Attributes

NameTypeDescription
objectobject or convertible primitiveValue to enumerate.

Return Value

Array of strings

New array of the described fields.

Working Example

Example Snippetjavascript
console.log(Object.keys({a:1,b:2}).join(","));
JavaScript Reference