JavaScript Tutorial:

JavaScript Strings

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

JavaScript Strings Examples:

Related JavaScript Tutorial Topics:

Other Tutorial Topics:

This modified content is an extract of the original Stack Overflow Documentation released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow. This topic was created and modified by the Stack Ovedrflow Contributor.