... | @@ -128,16 +128,16 @@ This convention works well with JavaScript because in JavaScript, functions and |
... | @@ -128,16 +128,16 @@ This convention works well with JavaScript because in JavaScript, functions and |
|
If a function literal is anonymous, there should be one space between the word `function` and the `(` (left parenthesis). If the space is omited, then it can appear that the function's name is `function`, which is an incorrect reading.
|
|
If a function literal is anonymous, there should be one space between the word `function` and the `(` (left parenthesis). If the space is omited, then it can appear that the function's name is `function`, which is an incorrect reading.
|
|
|
|
|
|
```javascript
|
|
```javascript
|
|
div.onclick = function (e) {
|
|
div.onclick = function (e) {
|
|
return false;
|
|
return false;
|
|
};
|
|
};
|
|
|
|
|
|
that = {
|
|
that = {
|
|
method: function () {
|
|
method: function () {
|
|
return this.datum;
|
|
return this.datum;
|
|
},
|
|
},
|
|
datum: 0
|
|
datum: 0
|
|
};
|
|
};
|
|
```
|
|
```
|
|
|
|
|
|
Use of global functions should be minimized.
|
|
Use of global functions should be minimized.
|
... | | ... | |