| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Iterator/some | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
Since 2025 3, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Iterator some() Array.prototype.some() . . .
some(callbackFn)
some() callbackFn . true . false . some() true , return() .
. , some() true . callbackFn , .
function* fibonacci() {
let current = 1;
let next = 1;
while (true) {
yield current;
[current, next] = [next, current + next];
}
}
const isEven = (x) => x % 2 === 0;
console.log(fibonacci().some(isEven)); // true
const isNegative = (x) => x < 0;
const isPositive = (x) => x > 0;
console.log(fibonacci().take(10).some(isNegative)); // false
console.log(fibonacci().some(isNegative)); //
some() . . .
const seq = fibonacci();
console.log(seq.some(isEven)); // true
console.log(seq.next()); // { value: undefined, done: true }
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-iterator.prototype.some |
core-js Iterator.prototype.some IteratorIterator.prototype.every()Iterator.prototype.find()Array.prototype.some()This page was last modified on 2025 1 11 by MDN contributors.
IteratorObject/FunctionObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toString()Object.prototype.valueOf()Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |