Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the abbreviation of multiline string by js

Shulou Source: shulou.com Published: 2022-06-01 05:56:15 10月24日 Update

Xiaobian to share with you how js to achieve multi-line string shorthand, I believe most people do not know how to share this article for your reference, I hope you have a lot of harvest after reading this article, let us go to understand it together!

Multiline String Abbreviations

When we deal with multiline strings in code, we can do this:

// Badconst data = 'abc abc abc abc abc abc\n\t'+ 'test test,test test test test\n\t'// Goodconst data = `abc abc abc abc abc abc test test,test test`The above is "js how to implement multi-line string shorthand" All the contents of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Tags: Characters strings multilines abbreviations articles content not much code most more knowledge industry information information channels channels references processing learning help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Microsoft Linux Xiaomi Shulou Information