Created
January 10, 2019 15:40
-
-
Save mateusmarquezini/f90cfd7f3839fd152364368a46dd78a1 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
let mapa = new WeakMap() | |
let pessoa = {} | |
let carro = {} | |
mapa.set(pessoa, "Eu sou uma pessoa") | |
mapa.set(carro, "Eu sou um carro") | |
console.log(mapa.get(pessoa)) // Eu sou uma pessoa | |
console.log(mapa.get(carro)) // Eu sou um carro |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment