list all properties of object javascript code example
Example 1: js select keys from object
const object = { a: 5, b: 6, c: 7 };
const picked = (({ a, c }) => ({ a, c }))(object);
console.log(picked);
Example 2: javascript list object properties
var person={"first_name":"Bill","last_name":"Jenner"}
var keys = Object.keys(person);
Example 3: javascript list class properties
function getClassProperties(instanceOfClass) {
const proto = Object.getPrototypeOf(instanceOfClass);
const names = Object.getOwnPropertyNames(proto);
return names.filter(name => name != 'constructor');
}