JSFiddle - React, Tailwind, and code Playground
by andypotanin
JavaScript
// https://developer.mozilla.org/en-US/docs/Enumerability_and_ownership_of_properties
function o( name ) {
this.name = name;
return this;
}
Object.defineProperties( o, {
"f1": {
"value": function f1() {},
"enumerable": false,
"configurable": true,
"writable": true
}
});
Object.defineProperties( o.prototype, {
"f2": {
"value": function f2() {},
"enumerable": true,
"configurable": true,
"writable": true
}
});
console.clear();
console.log( 'keys', Object.keys( o ) );
console.log( 'getOwnPropertyNames', Object.getOwnPropertyNames( o ) );
for( key in o ) {
console.log( key );
}