Réponse

localeCompare()

Colonne
Explication

const sTxt = "hello";
alert(sTxt.localeCompare("bonjour")); // Renvoie 1
alert(sTxt.localeCompare("hello")); // Renvoie 0
alert(sTxt.localeCompare("hi")); // Renvoie -1

Question

Quelle méthode permet de comparer deux chaînes texte ?

Thématique