backquote character (`, a.k.a. grave accent or backtick) to quote multiline literal strings, but this is supported only on certain browsers as of 2016: Firefox and Chrome, but not Internet Explorer 11. var greeting = "Hello, World!"; var anotherGreeting = 'Greetings, people of Earth.'; Individual characters within a string can be accessed using the method (provided by ). This is the preferred way when accessing individual characters within a string, because it also works in non-modern browsers: var h = greeting.charAt(0); In modern browsers, individual characters within a string can be accessed (as strings with only a single character) through the same notation as arrays: var h = greeting[0]; However, JavaScript strings are immutable: greeting[0] = "H"; // Fails. Applying the equality operator ("==") to two strings returns true, if the strings have the same contents, which means: of the same length and containing the same sequence of characters (case is significant for alphabets). Thus: var x = "World"; var compare1 = ("Hello, " +x == "Hello, World"); // Here compare1 contains true. var compare2 = ("Hello, " +x == "hello, World"); // Here compare2 contains ... // ... false since the ... // ... first characters ... // ... of both operands ... // ... are not of the same case. Quotes of the same type cannot be nested unless they are escaped. var x = '"Hello, World!" he said.'; // Just fine. var x = ""Hello, World!" he said."; // Not good. var x = "\"Hello, World!\" he said."; // Works by escaping " with \" The constructor creates a string object (an object wrapping a string): var greeting = new String("Hello, World!"); These objects have a method returning the primitive string wrapped within them: var s = new String("Hello !"); typeof s; // Is 'object'. typeof s.valueOf(); // Is 'string'. Equality between two objects does not behave as with string primitives: var s1 = new String("Hello !"); var s2 = new String("Hello !"); s1 == s2; // Is false, because they are two distinct objects. s1.valueOf() == s2.valueOf(); // Is true. Boolean JavaScript provides a Boolean data type with and literals. The operator returns the string for these primitive types. When used in a logical context, , , , , , and the empty string () evaluate as due to automatic type conversion. All other values (the complement of the previous list) evaluate as , including the