Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const obj = {}
- function updateObj(obj) {
- obj.key = 'abc'
- obj = null
- }
- console.log(obj)
- obj.key = 123
- console.log(obj)
- updateObj(obj)
- console.log(obj)
- // The output will be:
- // {}
- // { key: 123 }
- // { key: 'abc' }
Add Comment
Please, Sign In to add comment