> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/zloirock/core-js/llms.txt
> Use this file to discover all available pages before exploring further.

# Stage 2 and Below

> Experimental polyfills for early-stage TC39 proposals.

<Warning>
  These proposals are experimental. They may change significantly or be withdrawn entirely. Use them only for experimentation — not in production code unless you accept the risk of breaking changes.
</Warning>

These features require the `core-js/full` namespace (or explicit stage entry points) since they are not included in `core-js/actual`.

```js theme={null}
// Load all features including experimental proposals
import 'core-js/full';

// Or load a specific stage
import 'core-js/stage/2';   // Stage 2.7 + 2 + 3
import 'core-js/stage/1';   // Stage 1 + above
import 'core-js/stage/0';   // Stage 0 + above
import 'core-js/stage/pre'; // Pre-stage 0 + above
```

## Stage 2.7

### Iterator chunking

**Proposal:** [tc39/proposal-iterator-chunking](https://github.com/tc39/proposal-iterator-chunking)

Adds `Iterator.prototype.chunks` and `Iterator.prototype.windows` for splitting iterators into fixed-size chunks.

```js theme={null}
import 'core-js/proposals/iterator-chunking-v2';

[1, 2, 3, 4, 5].values().chunks(2).toArray();
// => [[1, 2], [3, 4], [5]]

[1, 2, 3, 4, 5].values().windows(3).toArray();
// => [[1, 2, 3], [2, 3, 4], [3, 4, 5]]

**Entry points:**
```

core-js/proposals/iterator-chunking-v2
core-js(-pure)/actual|full/iterator/chunks
core-js(-pure)/actual|full/iterator/windows

```

**Entry points:**
```

core-js/proposals/iterator-chunking
core-js(-pure)/actual|full/iterator/chunks
core-js(-pure)/actual|full/iterator/windows

````

## Stage 2

### AsyncIterator helpers

**Proposal:** [tc39/proposal-async-iterator-helpers](https://github.com/tc39/proposal-async-iterator-helpers)

```js
import 'core-js/proposals/async-iterator-helpers';

await AsyncIterator.from([1, 2, 3, 4, 5, 6, 7])
  .drop(1)
  .take(5)
  .filter(it => it % 2)
  .map(it => it ** 2)
  .toArray(); // => [9, 25]

await [1, 2, 3].values().toAsync().map(async it => it ** 2).toArray(); // => [1, 4, 9]
````

**Entry points:**

```
core-js/proposals/async-iterator-helpers
core-js(-pure)/actual|full/async-iterator
```

### Iterator.range

**Proposal:** [tc39/proposal-Number.range](https://github.com/tc39/proposal-Number.range)

```js theme={null}
import 'core-js/proposals/number-range';

for (const i of Iterator.range(1, 10)) {
  console.log(i); // => 1, 2, 3, 4, 5, 6, 7, 8, 9
}

for (const i of Iterator.range(1, 10, { step: 3, inclusive: true })) {
  console.log(i); // => 1, 4, 7, 10
}
```

**Entry points:**

```
core-js/proposals/number-range
core-js(-pure)/full/iterator/range
```

### Array.isTemplateObject

```js theme={null}
import 'core-js/proposals/array-is-template-object';

Array.isTemplateObject((it => it)`qwe${ 123 }asd`); // => true
```

### Number.prototype.clamp

```js theme={null}
import 'core-js/proposals/math-clamp-v2';

5.0.clamp(0, 10);   // => 5
-5.0.clamp(0, 10);  // => 0
15.0.clamp(0, 10);  // => 10
```

### String.dedent

```js theme={null}
import 'core-js/proposals/string-dedent';

const message = 42;
console.log(String.dedent`
  print('${ message }')
`); // => print('42')
```

### Symbol predicates

```js theme={null}
import 'core-js/proposals/symbol-predicates-v2';

Symbol.isRegisteredSymbol(Symbol.for('key')); // => true
Symbol.isRegisteredSymbol(Symbol('key'));      // => false
Symbol.isWellKnownSymbol(Symbol.iterator);    // => true
Symbol.isWellKnownSymbol(Symbol('key'));       // => false
```

## Stage 1

### Observable

```js theme={null}
import 'core-js/proposals/observable';

new Observable(observer => {
  observer.next('hello');
  observer.next('world');
  observer.complete();
}).subscribe({
  next(it) { console.log(it); },      // => 'hello', 'world'
  complete() { console.log('done'); },
});
```

**Entry points:**

```
core-js/proposals/observable
core-js(-pure)/full/observable
core-js(-pure)/full/symbol/observable
```

### New collections methods

Adds functional methods (`filter`, `map`, `reduce`, `find`, `every`, `some`, etc.) to `Set`, `Map`, `WeakSet`, and `WeakMap`.

```js theme={null}
import 'core-js/proposals/collection-methods';

new Set([1, 2, 3, 4]).filter(it => it % 2); // => Set {1, 3}
new Map([['a', 1], ['b', 2]]).map(v => v * 2); // => Map { 'a' => 2, 'b' => 4 }
```

Also adds `.of` and `.from` static methods to collection constructors:

```js theme={null}
import 'core-js/proposals/collection-of-from';

Set.of(1, 2, 3);                          // => Set {1, 2, 3}
Map.from([['a', 1]], ([k, v]) => [k, v]); // => Map { 'a' => 1 }
```

### compositeKey / compositeSymbol

```js theme={null}
import 'core-js/proposals/keys-composition';

const key = compositeKey({}, []);
const sym = compositeSymbol({}, []);
```

**Entry points:**

```
core-js/proposals/keys-composition
core-js(-pure)/full/composite-key
core-js(-pure)/full/composite-symbol
```

### Number.fromString

```js theme={null}
import 'core-js/proposals/number-from-string';

Number.fromString('42');    // => 42
Number.fromString('ff', 16); // => 255
```

### String.cooked

```js theme={null}
import 'core-js/proposals/string-cooked';

String.cooked`\u0041`; // => 'A'
```

### String.prototype.codePoints

```js theme={null}
import 'core-js/proposals/string-code-points';

[...'abc'.codePoints()]; // => [{ codePoint: 97, position: 0 }, ...]
```

## Stage 0

### Function.prototype.demethodize

```js theme={null}
import 'core-js/proposals/function-demethodize';

const slice = Array.prototype.slice.demethodize();
slice([1, 2, 3], 1); // => [2, 3]
```

### Function.isCallable / Function.isConstructor

```js theme={null}
import 'core-js/proposals/function-is-callable-is-constructor';

Function.isCallable(function () {});  // => true
Function.isCallable(() => {});        // => true
Function.isCallable(class {});        // => false
Function.isConstructor(class {});     // => true
Function.isConstructor(() => {});     // => false
```

## Pre-stage 0

### Reflect.metadata

```js theme={null}
import 'core-js/proposals/reflect-metadata';

const obj = {};
Reflect.defineMetadata('key', 'value', obj);
Reflect.getOwnMetadata('key', obj);   // => 'value'
Reflect.getOwnMetadataKeys(obj);      // => ['key']
```

**Entry points:**

```
core-js/proposals/reflect-metadata
core-js(-pure)/full/reflect/define-metadata
core-js(-pure)/full/reflect/get-metadata
core-js(-pure)/full/reflect/has-metadata
core-js(-pure)/full/reflect/metadata
```
