Skip to content

Instantly share code, notes, and snippets.

@mateusmarquezini
Created January 19, 2019 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mateusmarquezini/4d4a4312804523c9218a03acf1c5fadf to your computer and use it in GitHub Desktop.
Save mateusmarquezini/4d4a4312804523c9218a03acf1c5fadf to your computer and use it in GitHub Desktop.
let set1 = new Set([1, "dois", 3, "quatro", 5])
let set2 = new Set()
set2.add(1)
set2.add(2)
set2.add(3)
set2.add(4)
set2.add(5)
for (valor of set1){
console.log(valor) // 1, dois, 3, quatro, 5
}
for (valor of set2){
console.log(valor) // 1, 2, 3, 4, 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment