DEV Community

Khoi
Khoi

Posted on

Learning about string in JS

What does string in JavaScript mean?

  • A string is a sequence of one or more characters that may consist of letters, numbers, or symbols

Example:

let text = "Hello:)))";
Enter fullscreen mode Exit fullscreen mode
  • In the above code, myString is a variable that holds the value of the string "Hello, World!"
  • And to show the code to the screen, you will have to code like this:
 <p id="demo"></p>
    <script>
    let text = "Hello:)))";
    document.getElementById("demo").innerHTML = text;
    </script>
Enter fullscreen mode Exit fullscreen mode
  • your result will be like this: Image description

Top comments (0)