js string code example

Example 1: js string

`hello world`
`hello!
 world!`
`hello ${who}`
escape `<a>${who}</a>`

Example 2: js string

String(thing)

Example 3: js string

let longString = "This is a very long string which needs " +
                 "to wrap across multiple lines because " +
                 "otherwise my code is unreadable.";

Example 4: js string

return 'cat'.charAt(1); // returns "a"

Example 5: js string

let longString = "This is a very long string which needs \
to wrap across multiple lines because \
otherwise my code is unreadable.";

Example 6: js string

return 'cat'[1]; // returns "a"