javascript代码风格

[JavaScript Standard Style](https://standardjs.com)

Airbnb JavaScript Style  https://github.com/airbnb/javascript/tree/es5-deprecated/es5#types

当无分号代码风格时,当一行代码是以: (    [  ·反引号开头时,在前面补个;(!或~也可以)就不会报错除非是第一行

function say(){

console.log('hello world')

}

say()

;(function(){console.log('hello')})

;['苹果',‘香蕉’].foreach(function(item){console.log(item)})

`是EcmaScript6中新增的一种字符串包裹方式,叫做:模板字符串  支持换行和非常方便拼接变量

var foo=`大家好

hello

world`

console.log(foo)

猜你喜欢

转载自blog.csdn.net/qq_34412985/article/details/85218347