Suppose there is some javascript library object jsObj. When calling Object.keysor Object.getOwnPropertyNamesI get a list of properties like
[a,b,c,d]
But still, I can call a type function jsObj.e(). Why is the method enot part of Object.keysor Object.getOwnPropertyNames? How do they do it?
Here , it is said that Object.getOwnPropertyNamesit will also return enumerable properties. So what is the characteristic of a property like the one eabove.
I am using opentok on the server side of the SDK. Using the following code,
var OpenTok = require('opentok');
var opentok = new OpenTok(config.tokbox.apiKey, config.tokbox.secret);
console.log("opentok1", Object.getOwnPropertyNames(opentok));
prints ->
'apiKey',
'apiSecret',
'apiUrl',
'startArchive',
'stopArchive',
'getArchive',
'deleteArchive',
'listArchives' ]
console.log("opentok2", opentok.createSession);
prints -> function (...){...}
source
share