Vidyalelo
JavaScript · Q68

Invocation And Performance Navigation

Programming · JavaScript · question 68

Q68

What is the purpose of the method localeCompare()?

A.
If the reference string comes before or after another string
Answer
B.
If the reference string is validated
C.
If the string is a reference string
D.
None of the mentioned

Answer: Option A

Solution

Answer: Option A
Solution:
The method localeCompare() returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order.