js no semicolon code style

Copyright: To reprint please sign many bloggers agree https://blog.csdn.net/qq_27674439/article/details/91362506

`` `Is EcmaScript 6 string wrapped in a new way, called: template string
// and wrap it supports very convenient stitching variables
// var foo =` `` `
// Hello everyone
// hello bed moonlight
// world
// ha ha ha `` `
// console.log (foo)
because this editor to play a counter-quote is hidden, all the more hit a few, to understand the meaning of the line

When you are using a non semicolon code style, you can just pay attention to the following situations will not have the above problem:
// when a line of code is:
// (
// [
// / ``
// at the beginning when, then added something in front of the semicolon in order to avoid some parsing errors.
// so you will find in some third-party code to see one up on a; at the beginning.
// Conclusion:
// whether you the code is there a semicolon, have suggested that if a line of code is (, [, `the beginning, it is best to have added something in front of a semicolon.
// some people also like to play some fancy stuff, for example, use! ~ and so on.

Guess you like

Origin blog.csdn.net/qq_27674439/article/details/91362506