Created
July 26, 2019 14:21
-
-
Save changhuixu/fef748019eed61a870828ceb35410a26 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 userInput = JSON.parse('{"__proto__": {"admin": true}}') | |
var a = {...userInput} | |
console.log(a.admin) | |
// true | |
var b = Object.assign({}, userInput) | |
console.log(b.admin) | |
// true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment