<!DOCTYPE html> <html> <body> <script> var string1 = "World"; var string2 = "World"; var result = string1.localeCompare(string2); console.log(result) </script> </body> </html>
Do comment if you have any doubts or suggestions on this JS string code.
Note: The All JS Examples codes are tested on the Firefox browser and the Chrome browser.
OS: Windows 10
Code: HTML 5 Version
Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology & like learning technical.