Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • D digitec-wiki
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Digitec
  • digitec-wiki
  • Wiki
  • javascript coding standards

javascript coding standards · Changes

Page history
rcabral deleted page: backspace contact information authored Mar 29, 2016 by Rene Cabral's avatar Rene Cabral
Hide whitespace changes
Inline Side-by-side
javascript-coding-standards.markdown
View page @ 0771a6b9
...@@ -69,8 +69,8 @@ It is preferred that each variable be given its own line and comment. They shoul ...@@ -69,8 +69,8 @@ It is preferred that each variable be given its own line and comment. They shoul
```javascript ```javascript
var currentEntry; // currently selected table entry var currentEntry; // currently selected table entry
var level; // indentation level var level; // indentation level
var size; // size of table var size; // size of table
``` ```
JavaScript does not have block scope, so defining variables in blocks can confuse programmers who are experienced with other C family languages. Define all variables at the top of the function. JavaScript does not have block scope, so defining variables in blocks can confuse programmers who are experienced with other C family languages. Define all variables at the top of the function.
...@@ -85,15 +85,15 @@ There should be no space between the name of a function and the `(` (left parent ...@@ -85,15 +85,15 @@ There should be no space between the name of a function and the `(` (left parent
```javascript ```javascript
    function outer(c, d) { function outer(c, d) {
        var e = c * d; var e = c * d;
        function inner(a, b) { function inner(a, b) {
            return (e * a) + b; return (e * a) + b;
        } }
        return inner(0, 1);         return inner(0, 1);
    } }
``` ```
This convention works well with JavaScript because in JavaScript, functions and object literals can be placed anywhere that an expression is allowed. It provides the best readability with inline functions and complex structures. This convention works well with JavaScript because in JavaScript, functions and object literals can be placed anywhere that an expression is allowed. It provides the best readability with inline functions and complex structures.
......
Clone repository
  • alpha beta testing
  • browser testing
  • camtasia licenses
  • code delivery processes
  • coding practices
  • css and sass coding standards
  • database schema standards
  • dependency management
  • development environments
  • digitec agile process
  • digitec gitlab styles
  • digitec software promises
  • digitec spec process
  • gitlab administration
  • gitlab issues tags
View All Pages