Not sure why
hasOwnProperty()
someControllerFunction: function(req, res){
var data = req.body.loc;
...
}
data.hasOwnProperty('test');
Object object has no method 'hasOwnProperty'
The object may not have Object.prototype
as its prototype.
This is the case if the object was created with...
var data = Object.create(null);
You could use...
Object.prototype.hasOwnProperty.call(data, 'test');
...to test if the property exists.