DEV Community 👩‍💻👨‍💻

Discussion on: All front end Interview questions asked during my recent job hunt.

devabhijeet profile image
Abhijeet Yadav Author • Edited on

For this case, ASCII value of first character from both string are compared. Since the first char is 't' from both string, the resultant ASCII value will also be same. The evaluation then moves to the second character of both string.

Character 'w' from string one has ASCII value greater than ASCII value of character 'h' from string two, hence evaluation will now be of below state...

ASCII(w) > ASCII(h) => true
Enter fullscreen mode Exit fullscreen mode

Also the below evaluates to false

'tWo' > 'three' //false
Enter fullscreen mode Exit fullscreen mode