LogoClawIndex
CasesSkillsAbout
LogoClawIndex

js_tosorted_immutable - Use toSorted() Instead of sort() for Immutability

Replaces sort() with toSorted() to maintain array immutability in JavaScript code

Tags

Updated: 2026-02-13
javascriptarraysimmutabilityreactstatemutation

Capabilities

convert sort() to toSorted()implement immutable array sortingwrite immutable JavaScript code

Typical Inputs

JavaScript code with sort()array dataReact components

Typical Outputs

immutable sorted arraynon-mutating codepreserved original array

What this skill does

  • convert sort() to toSorted()
  • implement immutable array sorting
  • write immutable JavaScript code

Inputs

  • JavaScript code with sort()
  • array data
  • React components

Outputs

  • immutable sorted array
  • non-mutating code
  • preserved original array

Requirements

  • modern JavaScript environment
  • Chrome 110+ / Safari 16+ / Firefox 115+ / Node.js 20+
  • React application context

Source

  • Spec: SKILL.md

ClawIndex

OpenClaw Skills & Use Case Index

ClawIndex is an ecosystem-driven index of OpenClaw skills and real-world use cases.

Index

Skills·
Cases

Meta

About·
Disclaimer·
Email·
GitHub
© 2026 ClawIndex All Rights Reserved.