Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (15 sloc) 737 Bytes
// String sentence example. You can use single or double quotes.
"This is a tutorial on strings"
'This is a sentence'
// Incorrect use of strings with syntax error
var a = "This is a sample "sentence" here"
// Backslash to create a new line, or escape the character
"This is line one\nAnd this is the second line"
// Backslash with a t to tab or create a space
"This is line one\tAnd this is the second line"
// Turn special characters (i.e quotes, numerical signs, slashes, apostrophe etc.) into string characters
"This is a test \"that\" the backslashes won\'t appear."
"Here is another wacky test\! Here is a backslash... \\"
// Concatenation, or gluing strings together
"water" + "melon"
"water" + "melon " + "French" + "Fries"