How to get an array of function property names from own enumerable properties of an object in JavaScript ? Last Updated : 19 Jul, 2021 Comments Improve Suggest changes Like Article Like Report Enumerable Properties: All the properties of an object that can be iterated using for..in loop or Object.keys() method are known as enumerable properties. In this article, we will see how to get an array of functions of an object that are enumerable. It can be achieved by following these 2 steps. Using Object.keys() method, we can get an array of all enumerable properties (containing functions and data members) of an Object. Syntax: Object.keys(object_name) Then we can filter the above obtained array using Array filter() method so that it contains only enumerable function names (eliminating all data members). Syntax: new_arr = arr_name.filter( (element)=> {.....} ) In the following implementation for creating a non-enumerable property, we have used Object.defineProperty() method. Example: JavaScript <script> // Person object has name, age, salary // and print properties // Except salary, all properties are enumerable let Person = { name: "Mahesh", age: 25, print: function () { console.log(`${this.name} ${(this, age)}`); }, }; // salary- non enumerable property Object.defineProperty(Person, "salary", { value: "Rs. 50,000", enumerable: false, }); // greeting- non enumerable function Object.defineProperty(Person, "greeting", { value: function () { console.log("Welcome to GFG"); }, enumerable: false, }); // arr contains all the enumerable // properties of Person let arr = Object.keys(Person); // functionsArr contains enumerable // function properties of Person. // typeof returns an string representing // data type. // Using filter() method to filter the array let functionsArr = arr.filter((key) => { return typeof Person[key] === "function"; }); console.log(arr); console.log(functionsArr); </script> Output:["name", "age", "print"] ["print"]Explanation: In the above code, we have an object named Person with 3 data members (name, age and salary) and 2 functions ('print' and 'greeting') out of which salary data-member and greeting function are non-enumerable properties. PropertyTypeEnumerabilitynamevariableenumerableagevariableenumerablesalaryvariablenon-enumerableprintfunctionenumerablegreetingfunctionnon-enumerable Here 'print' is the only function which is enumerable. Using Object.keys(Person) we get an array containing all enumerable properties i.e. ["name", "age", "print"] . Then we used Array.filter() property to filter out all variables so that array has only function property names, i.e. ["print"]. Comment More infoAdvertise with us Next Article How to get an array of function property names from own enumerable properties of an object in JavaScript ? D durgeshpushpakar Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Methods JavaScript-Questions Similar Reads How to access object properties from result returned by async() function in JavaScript ? In this article, we will see how to access the properties of a javascript object result returned by the async() function in Javascript. A javascript object property is a variable that is associated (read attached) with the object itself, i.e. the properties have a name and value is one of the attrib 3 min read How to Sort an Array of Objects Based on a Key in JavaScript ? In JavaScript, sorting an array of objects based on the key consists of iterating over the array, applying the sort() method or other approaches, and arranging the array in the desired sorting order. Table of Content Using sort() methodUsing Custom Sorting FunctionUsing Lodash _.orderBy() MethodUsin 3 min read How to get Function Parameters from Keys in an Array of Objects Using TypeScript ? In TypeScript, we can extract the function parameters from keys in an array of objects by going through object properties dynamically. We can use Generics and Type Assertion to get Function Parameters from Keys in an Array of Objects Using TypeScript. Below are the possible approaches: Table of Cont 3 min read How to get property descriptors of an object in JavaScript ? Here, we are going to discuss the property descriptors of an Object in JavaScript. The Object.getOwnPropertyDescriptor() method returns an object describing a specific property on a given object. A JavaScript object can be created in many ways and its properties can be called by using property descr 2 min read How to get dynamic access to an object property in JavaScript ? In JavaScript, an object is a collection of properties, where each property consists of a key-value pair. Objects are a fundamental data type in JavaScript. You can create an object in JavaScript in the following ways: By using the object literal notation, which is a comma-separated list of key-valu 7 min read How to create a function that invokes the method at a given key of an object in JavaScript ? In JavaScript objects store variables in the key-value pair where the key is the property of the object and the value maybe the value of the property, or it may be any method that invokes when it is called. In this article, we will learn to invoke a method that is provided to key. Approach: Generall 2 min read How to get a subset of a javascript object's properties? To get the subset of properties of a JavaScript Object, we make use of destructuring and Property Shorthand. The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables.Syntax: subset = (({a, 2 min read How to convert a map to array of objects in JavaScript? A map in JavaScript is a set of unique key and value pairs that can hold multiple values with only a single occurrence. Sometimes, you may be required to convert a map into an array of objects that contains the key-value pairs of the map as the values of the object keys. Let us discuss some methods 6 min read How to read properties of an Object in JavaScript ? Objects in JavaScript, it is the most important data type and forms the building blocks for modern JavaScript. These objects are quite different from JavaScriptâs primitive data-types(Number, String, Boolean, null, undefined, and symbol) in the sense that these primitive data-types all store a singl 2 min read How to Traverse Array of Objects and Access the Properties in JavaScript? Here are the various methods to traverse an array of objects and access the properties in JavaScript1. Using forâ¦in loopThe for...in loop is used to iterate over the enumerable properties of an object. JavaScriptconst a = [ {name: 'Saritha', sub: 'Maths'}, {name: 'Sarthak', sub: 'Science'}, {name: ' 4 min read Like