Created
January 29, 2016 20:14
-
-
Save evilpie/a95265e8c804d6588735 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var object = { | |
__proto__: { | |
}, | |
a: 1, | |
b: 2, | |
c: 3 | |
} | |
for (var x in object) { | |
print(x); | |
if (x == "b") { | |
delete object.c; | |
} | |
} | |
print(" === "); | |
var object2 = { | |
__proto__: { | |
c: 3 | |
}, | |
a: 1, | |
b: 2, | |
} | |
for (var x in object2) { | |
print(x); | |
if (x == "b") { | |
delete object2.__proto__.c; | |
} | |
} | |
print(" === "); | |
var object3 = { | |
__proto__: { | |
}, | |
a: 1, | |
b: 2, | |
c: 3 | |
} | |
for (var x in object3) { | |
print(x); | |
if (x == "b") { | |
object3.__proto__.c = 30; | |
delete object3.c; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment