为什么要使用分号? [英] Why use semicolon?

查看:254
本文介绍了为什么要使用分号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了主观的视觉感知以及在同一行上有多个语句,在JavaScript中的语句结尾使用分号之外,还有什么原因吗?

Are there any reasons, apart from subjective visual perception and cases where you have multiple statements on the same line, to use semicolon at the end of statements in JavaScript?

看起来好像有很多证据表明使用分号是非常可选的,只在少数特定情况下需要。

It looks like that there's plenty of evidence suggesting that use of semicolons is highly optional and is required in only few of the specific cases.

推荐答案

http://aresemicolonsnecessaryinjavascript.com/ <- this is down now, use

https://github.com/aresemicolonsnecessaryinjavascript/aresemicolonsnecessaryinjavascript.github.com

这篇关于为什么要使用分号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆