JavaScriptStrings

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

Access character at index in string