编程语言/命名:修订间差异
来自康健生活
| 第13行: | 第13行: | ||
=== 函数命名 === | === 函数命名 === | ||
==== 普通函数命名 ==== | ==== 普通函数命名 ==== | ||
构造函数首字母应该{{underline|小| | 构造函数首字母应该{{underline|小|blue}}写<ref>Douglas Crockford. JavaScript: The Good Parts. O'Reily. 2008.</ref>。 | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
var nowDateLength = dateLength(nowDate); // dateLength is a ordinary function.</syntaxhighlight> | var nowDateLength = dateLength(nowDate); // dateLength is a ordinary function.</syntaxhighlight> | ||
==== 构造函数命名 ==== | ==== 构造函数命名 ==== | ||
构造函数首字母应该{{underline|大|bule}}写。 | 构造函数首字母应该{{underline|大|bule}}写。 | ||