Settings includes values on Object.prototype
See original GitHub issueApp settings pull from Object.prototype
if they’re missing on the settings
object.
const app = require('express')();
app.get('hasOwnProperty');
// => [Function: hasOwnProperty]
app.enabled('hasOwnProperty');
// => true
Is this intentional? If not, I’m happy to help fix.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Object prototypes - Learn web development | MDN
Prototypes are the mechanism by which JavaScript objects inherit features from one another. In this article, we explain what a prototype is, how ......
Read more >Proper way of setting fields in JavaScript using object prototype
As I wrote in the comment, I set each variables with the corresponding prototype 's value. In that way, if you do: alert(new...
Read more >Prototype methods, objects without __proto__
Setting or reading the prototype with obj. ... The prototype property of a constructor function has worked since very ancient times.
Read more >JavaScript Object Prototypes - W3Schools
All JavaScript objects inherit properties and methods from a prototype. In the previous chapter we learned how to use an object constructor: Example....
Read more >Understanding the prototype property in JavaScript - byte archer
The value holding the prototype of an object is sometimes called the internal prototype link. It's also been historically called __proto__, a name...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It sounds good, though I don’t think you can just ignore any inherited value – that is how the settings are inherited from parent apps to sub apps.
Likely good enough to just filter out if it in
Object.prototype
.