diff --git a/readme.md b/readme.md index ab9c04d..440a4b4 100644 --- a/readme.md +++ b/readme.md @@ -22,12 +22,14 @@ ````JavaScript // Returns undefined. No warning -return { - status: true - }; +return +{ + status: true +}; + // can be avoided by moving the bracket to the top line - return { - status: true +return { + status: true }; ```` - Reserved Words @@ -116,7 +118,7 @@ Delete another_stooge.nickname - Which is linked to Object.Prototype - Two additional properties: - Function's context (this) - - Code that implement's the function's behavior (arguments) + - Code that implements the function's behavior (arguments) - Also created w/ a prototype property - Independent of an object - If a value is a function, we consider it a method @@ -151,7 +153,7 @@ function outer() { ````JavaScript function outer() { - var name = "Bob'; + var name = "Bob"; function inner() { Alert(name); // 'Bob' } @@ -176,7 +178,7 @@ something(); // 'Bob' var myObject = { value: 0, increment: function ( inc ) { - this.value += typeof inc === 'number' ? Inc : 1; + this.value += typeof inc === 'number' ? inc : 1; } }; @@ -383,7 +385,7 @@ Private: ````JavaScript function Constructor(…){ - var = this + var self = this; var membername = value; function membername(…) {…} } @@ -583,7 +585,7 @@ var html = ['aaa', 'bbb', 'ccc', ...].join(''); // the function's *result* and not the function itself. var counter = (function(){ - var i = 0;== + var i = 0; return { get: function(){ @@ -626,4 +628,4 @@ function foo() { } // ... } ```` -Source: http://stackoverflow.com/questions/6396046/unlimited-arguments-in-a-javascript-function \ No newline at end of file +Source: http://stackoverflow.com/questions/6396046/unlimited-arguments-in-a-javascript-function