Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

localecompare javascript

let items = ['réservé', 'Premier', 'Cliché', 'communiqué', 'café', 'Adieu']

// ['Adieu', 'café', 'Cliché', 'communiqué', 'Premier', 'réservé']

console.log(items.sort( (a, b) => a.localeCompare(b, 'fr', {ignorePunctuation: true})));
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #localecompare #javascript
ADD COMMENT
Topic
Name
9+5 =