let str1="o";
let str2="a"

console.log(str1.localeCompare(str2))
//output is 1.
//because str2 pahale yetet according to alphabetical order