1.

What is the purpose of the method localeCompare()?(a) If the reference string comes before or after another string(b) If the reference string is validated(c) If the string is a reference string(d) If the reference string comes firstThe question was asked in an online quiz.The doubt is from Script Loading topic in chapter Invocation and Performance Navigation of JavaScript

Answer»

Correct option is (a) If the reference string comes before or after another string

Explanation: The localeCompare() method compares two strings in the current LOCALE. The locale is based on the language settings of the BROWSER. 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.



Discussion

No Comment Found

Related InterviewSolutions