How to create a string in JavaScript
In this tutorial, we are going to learn about how to create a string in JavaScript.
There three ways to create a string in JavaScript.
- The first way is using single quotes
''
.
const str = 'Hello'
- The second way is using the double quotes
""
.
const str = "Hello"
- The final way of creating a string is using the backticks.
const str = `Hello`