JavaScript Objects The Strings Object- localeCompare() - Javascript Objects

What is JavaScript String - localeCompare() Method?

JavaScript String - localeCompare() method returns a number indicating whether a reference string comes before or after or is the same as the given string in sorted order.

Syntax

The syntax of localeCompare() method is as follows -


Output

localeCompare first :-1

localeCompare second :1


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Javascript Objects Topics