プレイグラウンド
このインタラクティブプレイグラウンドで es-toolkit の関数を探索・実験できます。サイドバーから関数を選択してライブサンプルを確認するか、独自のコードを書いてみてください。
- at
- cartesianProduct
- chunk
- combinations
- compact
- countBy
- difference
- differenceBy
- differenceWith
- drop
- dropRight
- dropRightWhile
- dropWhile
- fill
- filterAsync
- flatMap
- flatMapAsync
- flatMapDeep
- flatten
- flattenDeep
- forEachAsync
- forEachRight
- groupBy
- head
- initial
- intersection
- intersectionBy
- intersectionWith
- isSubset
- isSubsetWith
- keyBy
- last
- limitAsync
- mapAsync
- maxBy
- minBy
- orderBy
- partition
- pull
- pullAt
- reduceAsync
- remove
- sample
- sampleSize
- shuffle
- sortBy
- tail
- take
- takeRight
- takeRightWhile
- takeWhile
- toFilled
- union
- unionBy
- unionWith
- uniq
- uniqBy
- uniqWith
- unzip
- unzipWith
- windowed
- without
- xor
- xorBy
- xorWith
- zip
- zipObject
- zipWith
- after
- ary
- asyncNoop
- before
- curry
- curryRight
- debounce
- flow
- flowRight
- identity
- memoize
- negate
- noop
- once
- partial
- partialRight
- rest
- retry
- spread
- throttle
- unary
- clamp
- inRange
- mean
- meanBy
- median
- medianBy
- percentile
- random
- randomInt
- range
- rangeRight
- round
- sum
- sumBy
- clone
- cloneDeep
- cloneDeepWith
- findKey
- flattenObject
- invert
- mapKeys
- mapValues
- merge
- mergeWith
- omit
- omitBy
- pick
- pickBy
- sortKeys
- toCamelCaseKeys
- toMerged
- toSnakeCaseKeys
- isArrayBuffer
- isBlob
- isBoolean
- isBrowser
- isBuffer
- isDate
- isEmptyObject
- isEqual
- isEqualWith
- isError
- isFile
- isFunction
- isJSON
- isJSONArray
- isJSONObject
- isJSONValue
- isLength
- isMap
- isNil
- isNode
- isNotNil
- isNull
- isNumber
- isPlainObject
- isPrimitive
- isPromise
- isRegExp
- isSet
- isString
- isSymbol
- isTypedArray
- isUndefined
- isWeakMap
- isWeakSet
- Mutex
- Semaphore
- allKeyed
- delay
- timeout
- withTimeout
- camelCase
- capitalize
- constantCase
- deburr
- escape
- escapeRegExp
- kebabCase
- lowerCase
- lowerFirst
- pad
- pascalCase
- reverseString
- snakeCase
- startCase
- trim
- trimEnd
- trimStart
- unescape
- upperCase
- upperFirst
- words
- countBy
- every
- filter
- find
- forEach
- keyBy
- map
- reduce
- some
- countBy
- every
- filter
- findKey
- findValue
- forEach
- hasValue
- keyBy
- mapKeys
- mapValues
- reduce
- some
- AbortError
- TimeoutError
- assert
- attempt
- attemptAsync
- invariant
関数を選択してください
import { chunk, groupBy, uniq } from 'es-toolkit'; // ============================================ // es-toolkit Playground // Try any function from the sidebar! // ============================================ // 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);

