Created
February 2, 2019 12:47
-
-
Save mateusmarquezini/d995438333a63ac1ea4b10429c3884a3 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 weakSet = new WeakSet() | |
let objeto1 = {} | |
let objeto2 = {} | |
let objeto3 = {} | |
// método add() | |
weakSet.add(objeto1) | |
weakSet.add(objeto2) | |
weakSet.add(objeto3) | |
// método delete() | |
weakSet.delete(objeto1) | |
// método has() | |
console.log(weakSet.has(objeto1)) // false | |
console.log(weakSet.has(objeto2)) // true | |
console.log(weakSet.has(objeto3)) // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment