2018-10-16 21:32:40 +05:30

27 lines
712 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Naming Convention for JavaScript
localeTitle: JavaScript的命名约定
---
在这里,您将了解广泛使用的不同代码案例。
## 骆驼香烟盒
在编程中变量名称的camelCase格式如下所示
```
var camelCase = "lower-case first word, capitalize each subsequent word";
```
## PascalCase
PascalCase或CamelCase是camelCase的变体。它与camelCase的不同之处在于大写每个单词 _包括_第一个单词
```
var PascalCase = "upper-case every word";
```
## snake\_case
另一个名为snake\_case的流行案例以这种方式用下划线分隔每个单词
```
var snake_case = "lower-case everything, but separate words with underscores";
```