Strings

Download javascript eBook

Syntax

  • "string literal"
  • 'string literal'
  • "string literal with 'mismatching quotes'" // no errors; quotes are different.
  • "string literal with "escaped quotes"" // no errors; quotes are escaped.
  • `template string ${expression}`
  • String("a b c") // returns string when called in non-constructor context
  • new String("a b c") // the String object, not the string primitive

Related Examples

Stats

749 Contributors: 33
Thursday, July 27, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook