by @codeexamples

How to create a string in JavaScript

Home » javascript » How to create a string in JavaScript

There three ways to create a string in JavaScript.

  1. The first way is using single quotes ''.
const str  = 'Hello'
  1. The second way is using the double quotes "".
const str  = "Hello"
  1. The final way of creating a string is using the backticks.
const str = `Hello`