Polluted Property Reflection
const ObjectSaya = {a: 4, b: 2};
// Polluted the property
ObjectSaya.prototype.foo = 'bar';
// Check the object doesn't have its own 'foo' property, only inherited
ObjectSaya.hasOwnProperty('foo'); // False
// List names of properties from the object
for(const x in ObjectSaya){
console.log{x}
}
// Output: a, b, fooconst ArraySaya = ['a', 'b'];
// Polluted the property
ArraySaya.prototype.foo = 'bar';
// List indexes from the array
for (const x in ArraySaya){
console.log{x}
}
// Output: 0, 1, fooLast updated