Explore and experiment with es-toolkit functions in this interactive playground. Select a function from the function list to see a live example, or write your own code.
import { chunk, groupBy, uniq } from 'es-toolkit'; // ============================================ // es-toolkit Playground // Try any function from the function list! // ============================================ // chunk(arr, size) // Splits an array into smaller arrays of the given size. const chunked = chunk([1, 2, 3, 4, 5, 6], 2); console.log('chunk:', chunked); // [[1, 2], [3, 4], [5, 6]] // uniq(arr) // Returns a new array with duplicates removed. const unique = uniq([1, 2, 2, 3, 3, 3]); console.log('uniq:', unique); // [1, 2, 3] // groupBy(arr, fn) // Groups array elements by a key returned from the callback. const grouped = groupBy( [ { name: 'Alice', age: 25 }, { name: 'Bob', age: 30 }, { name: 'Charlie', age: 25 }, ], item => item.age, ); console.log('groupBy:', grouped);

