Set.prototype.values()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itโs been available across browsers since โจ2015๋ 7์โฉ.
Set
์ธ์คํด์ค์ values()
๋ฉ์๋๋ ์์๊ฐ ์ฝ์
๋ ์์๋๋ก ๊ฐ ์์์ ๊ฐ์ ์ํํ ์ ์๋ ์๋ก์ด
set ๋ฐ๋ณต์ ๊ฐ์ฒด๋ฅผ ๋ฐํํฉ๋๋ค.
์๋ํด ๋ณด๊ธฐ
const set1 = new Set();
set1.add(42);
set1.add("forty two");
const iterator1 = set1.values();
console.log(iterator1.next().value);
// Expected output: 42
console.log(iterator1.next().value);
// Expected output: "forty two"
๊ตฌ๋ฌธ
js
values()
๋งค๊ฐ๋ณ์
์์.
๋ฐํ ๊ฐ
์๋ก์ด ์ํ ๊ฐ๋ฅํ ๋ฐ๋ณต์ ๊ฐ์ฒด.
์์
values()
์ฌ์ฉํ๊ธฐ
js
const mySet = new Set();
mySet.add("foo");
mySet.add("bar");
mySet.add("baz");
const setIter = mySet.values();
console.log(setIter.next().value); // "foo"
console.log(setIter.next().value); // "bar"
console.log(setIter.next().value); // "baz"
๋ช ์ธ์
Specification |
---|
ECMAScriptยฎ 2026 Language Specification # sec-set.prototype.values |
๋ธ๋ผ์ฐ์ ํธํ์ฑ
Loadingโฆ