From 12f7916636d0a0951eda20f65241e86eb0d81fe4 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 3 Mar 2015 13:53:42 +0000 Subject: [PATCH 1/6] Fixing semicolon insertion example The example for the undesired semicolon insertion still had the curly brace on the return line. I have moved it to the next line so it demonstrates the problem. --- readme.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index ab9c04d..b287ad6 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 @@ -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 From 43df8fc50305a7f96ed050da6620f0209751ca4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Ren=C3=A9e=20Beach?= Date: Tue, 3 Mar 2015 12:26:51 -0500 Subject: [PATCH 2/6] Fix syntax error 'var = this' --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index b287ad6..2d34679 100644 --- a/readme.md +++ b/readme.md @@ -385,7 +385,7 @@ Private: ````JavaScript function Constructor(…){ - var = this + var self = this; var membername = value; function membername(…) {…} } From 094595e407660cf541d5b4ef0bfd27a5f6b08418 Mon Sep 17 00:00:00 2001 From: Brian Rhea Date: Tue, 3 Mar 2015 10:31:08 -0700 Subject: [PATCH 3/6] implement's to implements --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index b287ad6..10d58c1 100644 --- a/readme.md +++ b/readme.md @@ -118,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 From 320f9baea775ebae3cda81f2744aab373aec0d9f Mon Sep 17 00:00:00 2001 From: Brian Rhea Date: Tue, 3 Mar 2015 10:31:55 -0700 Subject: [PATCH 4/6] close Bob with a quote instead of apostrophe --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 10d58c1..7a3d28e 100644 --- a/readme.md +++ b/readme.md @@ -153,7 +153,7 @@ function outer() { ````JavaScript function outer() { - var name = "Bob'; + var name = "Bob"; function inner() { Alert(name); // 'Bob' } From db7274d830d18a23849994644c7e4aec5c2a2dd4 Mon Sep 17 00:00:00 2001 From: Brian Rhea Date: Tue, 3 Mar 2015 10:46:28 -0700 Subject: [PATCH 5/6] fixed Inc is not defined in the method invocation example --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 7a3d28e..913531b 100644 --- a/readme.md +++ b/readme.md @@ -178,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; } }; From 9e3cac9197c8a4458a84240cd0041e5952f1e307 Mon Sep 17 00:00:00 2001 From: Diego Cardozo Date: Fri, 6 Mar 2015 14:29:20 -0200 Subject: [PATCH 6/6] Fixed typo Removed '==' --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 72dd20b..440a4b4 100644 --- a/readme.md +++ b/readme.md @@ -585,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(){