June 2014
Intermediate to advanced
696 pages
38h 52m
English
The String object is by far the most commonly used object in JavaScript. JavaScript automatically creates a String object for you any time you define a variable that has a string data type. For example:
var myStr = "Teach Yourself jQuery & JavaScript in 24 Hours";
When you create a string, there are a few special characters that you can’t add directly to the string. For those characters, JavaScript provides a set of escape codes, listed in Table 2.5.
Table 2.5 String object escape codes
To determine the length of a string, you can use the length property of the String object, as in this example: ...
Read now
Unlock full access