JavaScript Object.getOwnPropertyNames() MethodThe Object.getOwnPropertyNames() method returns an array of all properties (except those non-enumerable properties which use symbol) found directly upon a given object. Syntax:Parameter:obj: It is the object whose enumerable and non-enumerable own properties are to be returned. Return value:This method returns an array of string that correspond to the properties found directly upon the object. Browser Support:
Example 1Output: ["a", "b", "c"] Example 2Output: ["0", "1", "2"] "0 -> a" "1 -> b" "2 -> c" Example 3Output: size,shape Next TopicJavaScript Objects |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India