In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "whether es6 can use double quotes". In daily operation, I believe many people have doubts about whether es6 can use double quotes. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "whether es6 can use double quotes". Next, please follow the editor to study!
Es6 can be in double quotation marks. In es6, you can use double quotes to define a string, a string is a single quote or double quotation marks wrapped around the text, syntax "var variable name =" string text "; if quotation marks are used, you need to take" outer double inner single "or" outer single inner double "format to ensure that internal and external quotation marks are different, inner quotation marks can also be escaped.
The operating environment of this tutorial: windows7 system, ECMAScript version 6, Dell G3 computer.
Es6 can be in double quotation marks.
In es6, strings can be defined in double quotes.
A string (String) is a piece of text wrapped in single or double quotation marks, such as' 123', "abc".
Var str = "coffee."; / / double quotation marks var str = 'left'; / / single quotation marks
It is important to note that single and double quotes are different ways to define a string and are not part of a string.
When defining a string, if the string contains quotation marks, you can use the backslash\ to escape the quotation marks in the string, or choose a different quotation mark from the string to define the string (can take the format of "outer double inner single" or "outer single inner double").
Var str = "Let's have a cup of coffee."; / A double quotation mark contains single quotation marks var str ='He said "Hello" and left.'; / / single quotation marks contain double quotation marks var str ='We\'ll never give up.'; / / escape single quotation marks in a string using a backslash
Extended knowledge: the difference between single quotes and double quotes
(1) A character-only string. There is no difference between single quotation marks and double quotation marks.
(2) double quotation marks can be used directly in the string included in single quotation marks, and single quotation marks can be used directly in the string included in double quotation marks.
(3) if you use double quotation marks in a string enclosed in double quotation marks, you need to escape with a backslash, note that it is "\". Similarly, if you use single quotation marks in a string included in single quotation marks, you also need to escape "\".
At this point, the study on "whether es6 can use double quotation marks" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.