I am trying to exclude the property c if found so it won't be added to the properties array, however, it is being added still. Why?
var letters = function () {
this.a = 5;
this.b = 20;
};
letters.prototype = {
c: 10
};
var letters = new letters();
function looping(obj) {
var properties = [];
for (var key in obj) {
if (!obj.hasOwnProperty("c")) {
properties.push(key);
}
}
return properties;
}
looping(letters);