You can use Object.getOwnPropertyNames() to get all properties that belong to an object, whether enumerable or not. For example:

console.log(Object.getOwnPropertyNames(Math));
//-> ["E", "LN10", "LN2", "LOG2E", "LOG10E", "PI", ...etc ]

You can then use filter() to obtain only the methods:

console.log(Object.getOwnPropertyNames(Math).filter(function (p) {
    return typeof Math[p] === 'function';
}));
//-> ["random", "abs", "acos", "asin", "atan", "ceil", "cos", "exp", ...etc ]

In ES3 browsers (IE 8 and lower), the properties of built-in objects aren't enumerable. Objects like window and document aren't built-in, they're defined by the browser and most likely enumerable by design.

From ECMA-262 Edition 3:

Global Object
There is a unique global object (15.1), which is created before control enters any execution context. Initially the global object has the following properties:

• Built-in objects such as Math, String, Date, parseInt, etc. These have attributes { DontEnum }.
• Additional host defined properties. This may include a property whose value is the global object itself; for example, in the HTML document object model the window property of the global object is the global object itself.

As control enters execution contexts, and as ECMAScript code is executed, additional properties may be added to the global object and the initial properties may be changed.

I should point out that this means those objects aren't enumerable properties of the Global object. If you look through the rest of the specification document, you will see most of the built-in properties and methods of these objects have the { DontEnum } attribute set on them.


Update: a fellow SO user, CMS, brought an IE bug regarding { DontEnum } to my attention.

Instead of checking the DontEnum attribute, [Microsoft] JScript will skip over any property in any object where there is a same-named property in the object's prototype chain that has the attribute DontEnum.

In short, beware when naming your object properties. If there is a built-in prototype property or method with the same name then IE will skip over it when using a for...in loop.

Answer from Andy E on Stack Overflow
🌐
W3Schools
w3schools.com › js › js_object_methods.asp
JavaScript Object Methods
This example uses the JavaScript toUpperCase() method to convert a text to uppercase:
🌐
TutorialsPoint
tutorialspoint.com › javascript › javascript_builtin_functions.htm
JavaScript Built-in Functions Reference
Here, you can find all the JavaScript's built-in methods on the following classes: Number Methods · Boolean Methods · String Methods · String HTML Wrappers · Array Methods · Date Methods · Date Static Methods · Math Methods · RegExp Methods · The Number object contains only the default methods that are part of every object's definition. Here is a list of each method and its description.
🌐
Medium
medium.com › @mandeepkaur1 › a-list-of-javascript-array-methods-145d09dd19a0
A List of JavaScript Array Methods | by Mandeep Kaur | Medium
February 28, 2020 - This method adds one or more elements to the beginning of an array and returns the new length of the array. ... To make JavaScript array manipulation easier, we should use array methods to make our work easier and the code cleaner.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference
JavaScript reference - MDN Web Docs - Mozilla
1 week ago - JavaScript standard built-in objects, along with their methods and properties.
🌐
Medium
codegirljs.medium.com › javascript-methods-list-a-comprehensive-guide-aca79dd1f68a
JavaScript Methods List: A Comprehensive Guide | by Skylar Johnson | Medium
July 12, 2023 - In this article, we’ll look at some of the most common JavaScript methods. We cover methods of working with the DOM, event handling, and creating functions.
Top answer
1 of 11
391

You can use Object.getOwnPropertyNames() to get all properties that belong to an object, whether enumerable or not. For example:

console.log(Object.getOwnPropertyNames(Math));
//-> ["E", "LN10", "LN2", "LOG2E", "LOG10E", "PI", ...etc ]

You can then use filter() to obtain only the methods:

console.log(Object.getOwnPropertyNames(Math).filter(function (p) {
    return typeof Math[p] === 'function';
}));
//-> ["random", "abs", "acos", "asin", "atan", "ceil", "cos", "exp", ...etc ]

In ES3 browsers (IE 8 and lower), the properties of built-in objects aren't enumerable. Objects like window and document aren't built-in, they're defined by the browser and most likely enumerable by design.

From ECMA-262 Edition 3:

Global Object
There is a unique global object (15.1), which is created before control enters any execution context. Initially the global object has the following properties:

• Built-in objects such as Math, String, Date, parseInt, etc. These have attributes { DontEnum }.
• Additional host defined properties. This may include a property whose value is the global object itself; for example, in the HTML document object model the window property of the global object is the global object itself.

As control enters execution contexts, and as ECMAScript code is executed, additional properties may be added to the global object and the initial properties may be changed.

I should point out that this means those objects aren't enumerable properties of the Global object. If you look through the rest of the specification document, you will see most of the built-in properties and methods of these objects have the { DontEnum } attribute set on them.


Update: a fellow SO user, CMS, brought an IE bug regarding { DontEnum } to my attention.

Instead of checking the DontEnum attribute, [Microsoft] JScript will skip over any property in any object where there is a same-named property in the object's prototype chain that has the attribute DontEnum.

In short, beware when naming your object properties. If there is a built-in prototype property or method with the same name then IE will skip over it when using a for...in loop.

2 of 11
77

It's not possible with ES3 as the properties have an internal DontEnum attribute which prevents us from enumerating these properties. ES5, on the other hand, provides property descriptors for controlling the enumeration capabilities of properties so user-defined and native properties can use the same interface and enjoy the same capabilities, which includes being able to see non-enumerable properties programmatically.

The getOwnPropertyNames function can be used to enumerate over all properties of the passed in object, including those that are non-enumerable. Then a simple typeof check can be employed to filter out non-functions. Unfortunately, Chrome is the only browser that it works on currently.

function getAllMethods(object) {
    return Object.getOwnPropertyNames(object).filter(function(property) {
        return typeof object[property] == 'function';
    });
}

console.log(getAllMethods(Math));

logs ["cos", "pow", "log", "tan", "sqrt", "ceil", "asin", "abs", "max", "exp", "atan2", "random", "round", "floor", "acos", "atan", "min", "sin"] in no particular order.

🌐
freeCodeCamp
freecodecamp.org › news › 7-javascript-methods-that-will-boost-your-skills-in-less-than-8-minutes-4cc4c3dca03f
These JavaScript methods will boost your skills in just a few minutes
May 6, 2018 - Example: Let’s say you want to show a list of favorite foods without creating a loop function. Use a spread operator like this: The for...of statement loops/iterates through the collection, and provides you the ability to modify specific items. It replaces the conventional way of doing a for-loop. ... Example: Let’s say you have a toolbox, and you want to show all the tools inside it. The for...of iterator makes it easy. ... The includes() method is used to check if a specific string exists in a collection, and returns true or false.
Find elsewhere
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array
Array - JavaScript - MDN Web Docs
July 28, 2026 - The array's object properties and list of array elements are separate, and the array's traversal and mutation operations cannot be applied to these named properties. Array elements are object properties in the same way that toString is a property (to be specific, however, toString() is a method). Nevertheless, trying to access an element of an array as follows throws a syntax error because the property name is not valid: ... JavaScript ...
🌐
Flavio Copes
flaviocopes.com › home › javascript › how to list all methods of an object in javascript
How to list all methods of an object in JavaScript - Flavio Copes
August 7, 2026 - To list the methods of an object, get its property names with Object.getOwnPropertyNames() and keep the ones whose value is a function. To also include inherited methods, walk the prototype chain and repeat the check at each level.
🌐
Coding Dojo
codingdojo.com › blog › 15-top-javascript-methods
15 Top JavaScript Methods To Boost Your Skills - Coding Dojo
February 17, 2023 - Below are the fifteen JavaScript object methods: ... The includes() method focuses on finding out whether an array (a data structure comprising a list of items, each of which stores several elements in a single variable) holds a specific value within its list, then responds with either true or false.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-array-methods
JavaScript Array Methods - GeeksforGeeks
The filter() method in JavaScript creates a new array with all elements that pass the test implemented by the provided function.
Published: June 1, 2026
🌐
Playcode
playcode.io › javascript › methods
JavaScript Object Methods & the this Keyword | Playcode
Learn JavaScript object methods, define functions inside objects, understand the this keyword, use method shorthand, and avoid common mistakes.
🌐
Programiz
programiz.com › javascript › methods
JavaScript Methods and this Keyword (with Examples)
Inside the introduce() method, we used this.name and this.age to refer to the name and age keys of the person object. To learn more, visit JavaScript this.
🌐
tutorialstonight
tutorialstonight.com › js › javascript-array-methods
28 Javascript Array Methods (Complete List)
Javascript array methods are built-in functions in javascript which has a special task. forEach, sort, map, split, etc are the most useful array methods.
🌐
DEV Community
dev.to › snehalkadwe › essential-javascript-es6-methods-every-developer-should-know-4fnk
Essential JavaScript Methods Every Developer Should Know - DEV Community
February 28, 2024 - ... Async, await, for, in, of, const, let, try,?., and many more. Npm, how to avoid main thread locks, prototyping, jsdoc, v8,... And many more. There are just so many... Instead of listing them you should focus on the node first and it's ...
🌐
DEV Community
dev.to › codewithtee › 15-array-methods-in-javascript-1p1m
15+ Array Methods in Javascript - DEV Community
September 6, 2022 - The Array.map() method is commonly used to apply some changes to the elements, whether multiplying by a specific number as in the code above, or doing any other operations that you might require for your application. ... In JavaScript, concat() is a string method that is used to concatenate strings together.
🌐
Medium
medium.com › @juliamadeofshoes › most-common-javascript-methods-and-gotchas-329ef2b99509
Most Common Javascript Methods and Gotchas | by Julia Zhao Xu | Medium
April 18, 2019 - Remember, method syntax in Objects is different from other data structures. You must declare Object.methodName(obj). Using methods on Objects is not that common. For the most part, use dot and bracket notation to manipulate Objects or iterate through it. Object.keys(obj); Returns an array with a list of the keys as strings.