how to check whether two strings are equal in JavaScript code example Example: compare if strings are equal javascript new String("a") == new String("a")