+ 2
I am still confused pertaining to the use of backslach
2 Answers
+ 3
Escape-Sequence character (search it on Google)
+ 3
The backslash is used to tell the compiler/interpreter "Hey, this next character is to be treated differently!". For example, if you want to store the string, "My favorite movie is 'Raising Arizona', by the Cohen brothers." as a variable, you would run into problems using the quotes around the title, Raising Arizona. To let the compiler/interpreter know that you want the quotes to be part of the string, and not the end of the variable, you use the backslash. The result would look like this:
var movie = 'My favorite movie is \'Raising Arizona\', by the Cohen brothers.';
Also, there are special uses of certain letters to request non-printable characters. Using "\n" says, "Make a new line". Using "\t" says, "Insert a tab character", etc.