Last active
March 29, 2020 07:03
-
-
Save whoiskai/410c5a33f6cd4e9aa4f9d4f19d41c41e 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
function Transform(obj) { | |
let item = DeepCopy(obj) | |
try { | |
item.name = "Orange"; | |
item.price = obj.price/0; | |
return item; | |
} catch (e) { | |
// ... | |
} | |
} | |
const apple = { name: "Apple", price: 2 } | |
const orange = Transform(apple); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment