Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the difference between the three quotation marks in the js string

Shulou Source: shulou.com Published: 2022-06-03 17:33:54 10月03日 Update

This article introduces the relevant knowledge of "what is the difference between the three quotation marks in the js string". In the operation of the actual case, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Strings can be enclosed in single quotation marks, double quotation marks, or backquotes.

2. Single quotation marks and double quotes are basically the same. Backquotation marks allow us to pass ${... } embed any expression in the string. Allows string wrapping.

Example

/ / usage / / you can insert variables and expressions var a = "Hello"; alert (`$ {a} World`); / / Hello World / / you can wrap the line let row = `first line Second line Third line`; "what's the difference between the three quotation marks in the js string?" that's it. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Quotation marks characters strings content more knowledge expressions practical identical learned and then variables dilemmas examples actual situation articles cases ribbons websites Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft vpn Apple Shulou Information Linux