---
schema_version: "1"
id: 7e130b66fb6be6abc43fa255fd200ef75faf969ed3b541dd9fd613db07c57f8f
title: Script API Sort Methods Are Stable
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/commerce/264-0-0/rn_b2c_script_api_sort_stable.md
canonical_url: https://help.salesforce.com/s/articleView?id=commerce.rn_b2c_script_api_sort_stable.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ed74a3e5f71cc7577a70a51cfb27a3f007b17c9fa6f6f2ff382d03261b6a580d
description: As required by ECMAScript 2019, the B2C Commerce Script API methods Array.sort() and Array.sort(function) are now documented as stable, so equal elements aren’t reordered as a result of the sort.
products:
  - Commerce
  - B2C Commerce
release: "264"
---
# Script API Sort Methods Are Stable

As required by ECMAScript 2019, the B2C Commerce Script API methods Array.sort() and Array.sort(function) are now documented as stable, so equal elements aren’t reordered as a result of the sort.