Object static methods
Object.keys()
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
| Name | Type | Description |
|---|---|---|
| object | object or convertible primitive | Value 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(","));