Here is the code snippet:
console.log(typeof res.locals);
console.log(res.locals.hasOwnProperty('a'));
Result :
object
Unhandled rejection TypeError: res.locals.hasOwnProperty is not a function
Note 1: The 'res' object is from Express response;
I am using Express 4.13.3 . Does anyone know what the issue might be here?
NOTE :
var a = Object.create(null);
var b = {};
a.hasOwnProperty('test');
b.hasOwnProperty('test');
I discovered a bug where Object.create(null) does not create a JavaScript object with built-in functions.