9.9 Strings
You’ve been using strings for quite a while now, but you’ve been using them in a bare-bones fashion. In this section, you’ll learn about some of the functionality that JavaScript provides to make working with strings easier. That added functionality is particularly important because strings are used so often for processing user input. In this section, you’ll learn about string operators, hard-to-represent string characters (such as the quote character), and also string methods.
Comparison Operators
In the improved Game Night web page, remember the following prompt for the user’s name and the if
statement that verifies that the user entered something?
var name; // user's name name = prompt("What's your name?"); if (name != null) ...
Get Web Programming with HTML5, CSS, and JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.