JS
严格模式
严格模式的改变
开启严格模式
严格模式的具体变化
function func() { "use strict"; func.caller.name func.arguments } function f1(a, b) { return func(a, b); } f1(1, 2); // Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to themfunction func() { "use strict"; arguments.callee } func() // Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
代码规范
命名规范
普通变量命名
JavaScript变量起名类型
变量命名前缀
举例
函数命名
构造函数(类)命名
其他命名
API 文档(注释)
参考资料
最后更新于