diff --git a/doc/en/core/semicolon.md b/doc/en/core/semicolon.md index 61d74fd9..13449612 100644 --- a/doc/en/core/semicolon.md +++ b/doc/en/core/semicolon.md @@ -84,7 +84,7 @@ Below is the result of the parser's "guessing" game. })(window); //<- inserted > **Note:** The JavaScript parser does not "correctly" handle return statements -> which are followed by a new line, while this is not neccessarily the fault of +> which are followed by a new line, while this is not necessarily the fault of > the automatic semicolon insertion, it can still be an unwanted side-effect. The parser drastically changed the behavior of the code above, in certain cases diff --git a/doc/en/core/undefined.md b/doc/en/core/undefined.md index b29da3b4..12d587fa 100644 --- a/doc/en/core/undefined.md +++ b/doc/en/core/undefined.md @@ -22,7 +22,7 @@ Some examples for when the value `undefined` is returned: - Implicit returns of functions due to missing `return` statements. - `return` statements which do not explicitly return anything. - Lookups of non-existent properties. - - Function parameters which do not had any explicit value passed. + - Function parameters that do not have any explicit value passed. - Anything that has been set to the value of `undefined`. ### Handling Changes to the Value of `undefined` diff --git a/doc/en/function/arguments.md b/doc/en/function/arguments.md index 3d551ad5..0c2fbf36 100644 --- a/doc/en/function/arguments.md +++ b/doc/en/function/arguments.md @@ -89,7 +89,7 @@ more than a simple access to the `arguments` object's properties. > **ES5 Note:** These *getters* and *setters* are not created in strict mode. -However, there is one case which will drastically reduce the performance in +However, there is one case that will drastically reduce the performance in modern JavaScript engines. That case is the use of `arguments.callee`. function foo() { diff --git a/doc/en/function/closures.md b/doc/en/function/closures.md index 17554dcb..dc3feb66 100644 --- a/doc/en/function/closures.md +++ b/doc/en/function/closures.md @@ -46,7 +46,7 @@ override - the *global* variable `count`. ### Closures Inside Loops -One often made mistake is to use closures inside of loops, as if they were +One mistake made frequently is to use closures inside of loops, as if they were copying the value of the loops index variable. for(var i = 0; i < 10; i++) { @@ -85,7 +85,7 @@ The anonymous function that gets passed to `setTimeout` now has a reference to `e`, whose value does **not** get changed by the loop. There is another possible way of achieving this; that is to return a function -from the anonymous wrapper, that will then have the same behavior as the code +from the anonymous wrapper, which will then have the same behavior as the code above. for(var i = 0; i < 10; i++) { diff --git a/doc/en/function/constructors.md b/doc/en/function/constructors.md index ad90b028..072c1187 100644 --- a/doc/en/function/constructors.md +++ b/doc/en/function/constructors.md @@ -86,7 +86,7 @@ not using the `new` keyword. ### Creating New Objects via Factories -An often made recommendation is to **not** use `new` since forgetting its use +A recommendation frequently made is to **not** use `new` since forgetting its use may lead to bugs. In order to create new object, one should rather use a factory and construct a diff --git a/doc/en/function/scopes.md b/doc/en/function/scopes.md index 7ae5e4f5..8de9755b 100644 --- a/doc/en/function/scopes.md +++ b/doc/en/function/scopes.md @@ -72,7 +72,7 @@ unless the *desired effect* is to affect the outer scope. ### Local Variables -The only source for local variables in JavaScript are +The only sources of local variables in JavaScript are [function](#function.general) parameters and variables that were declared via the `var` statement. @@ -175,8 +175,8 @@ moved to the top of the *global scope*. All scopes in JavaScript, including the *global scope*, have the special name [`this`](#function.this) defined in them, which refers to the *current object*. -Function scopes also have the name [`arguments`](#function.arguments) defined in -them which contains the arguments that were passed to a function. +Function scopes also have the variable [`arguments`](#function.arguments) defined in +them. [`arguments`](#function.arguments) contains the arguments that were passed to a function. For example, when trying to access a variable named `foo` inside the scope of a function, JavaScript will lookup the name in the following order: diff --git a/doc/en/intro/index.md b/doc/en/intro/index.md index 6ddd7c71..a9701ce8 100644 --- a/doc/en/intro/index.md +++ b/doc/en/intro/index.md @@ -1,7 +1,7 @@ ## Intro -**JavaScript Garden** is a growing collection of documentation about the most -quirky parts of the JavaScript programming language. It gives advice to +**JavaScript Garden** is a growing collection of documentation about the +quirkiest parts of the JavaScript programming language. It gives advice to avoid common mistakes, subtle bugs, as well as performance issues and bad practices that non-expert JavaScript programmers may encounter on their endeavours into the depths of the language. diff --git a/doc/en/object/forinloop.md b/doc/en/object/forinloop.md index 30751ed9..2bb95c92 100644 --- a/doc/en/object/forinloop.md +++ b/doc/en/object/forinloop.md @@ -16,7 +16,7 @@ chain when iterating over the properties of an object. } Since it is not possible to change the behavior of the `for in` loop itself, it -is necessary to filter out the unwanted properties inside the loop body , +is necessary to filter out the unwanted properties inside the loop body, this is done by using the [`hasOwnProperty`](#object.hasownproperty) method of `Object.prototype`. @@ -37,7 +37,7 @@ will **only** print out `moo`. When `hasOwnProperty` is left out, the code is prone to errors in cases where the native prototypes - e.g. `Object.prototype` - have been extended. -One widely used framework which does this is [Prototype][1]. When this +One widely used framework that does this is [Prototype][1]. When this framework is included, `for in` loops that do not use `hasOwnProperty` are guaranteed to break. diff --git a/doc/en/object/prototype.md b/doc/en/object/prototype.md index f780eba2..d61d7de3 100644 --- a/doc/en/object/prototype.md +++ b/doc/en/object/prototype.md @@ -105,7 +105,7 @@ the features of newer JavaScript engines; for example, ### In Conclusion It is a **must** to understand the prototypal inheritance model completely -before writing complex code which makes use of it. Also, watch the length of +before writing complex code that makes use of it. Also, watch the length of the prototype chains and break them up if necessary to avoid possible performance issues. Further, the native prototypes should **never** be extended unless it is for the sake of compatibility with newer JavaScript features. diff --git a/doc/en/other/timeouts.md b/doc/en/other/timeouts.md index d196a3b7..c401fc1b 100644 --- a/doc/en/other/timeouts.md +++ b/doc/en/other/timeouts.md @@ -19,7 +19,7 @@ gets executed might block the thread, it is by **no means** a safe bet that one will get the exact delay that was specified in the `setTimeout` call. The function that was passed as the first parameter will get called by the -*global object*, that means, that [`this`](#function.this) inside the called function +*global object*, which means that [`this`](#function.this) inside the called function refers to that very object. function Foo() { @@ -62,7 +62,7 @@ it waiting for execution. ### Dealing with Possible Blocking Code -The easiest as well as most controllable solution, is to use `setTimeout` within +The easiest as well as most controllable solution is to use `setTimeout` within the function itself. function foo(){ diff --git a/doc/en/types/casting.md b/doc/en/types/casting.md index 15d84e74..328fea4c 100644 --- a/doc/en/types/casting.md +++ b/doc/en/types/casting.md @@ -47,7 +47,7 @@ The best option is to cast to one of the three possible types **explicitly**. '' + 10 === '10'; // true -By prepending a empty string a value can easily be casted to a string. +By prepending an empty string a value can easily be casted to a string. ### Casting to a Number diff --git a/doc/en/types/typeof.md b/doc/en/types/typeof.md index e4b28d7f..6985b5c6 100644 --- a/doc/en/types/typeof.md +++ b/doc/en/types/typeof.md @@ -9,7 +9,7 @@ practical use case, which does **not** happen to be checking the type of an object. > **Note:** While `typeof` can also be called with a function like syntax -> i.e. `typeof(obj)`, this is not a function call. The two parenthesis will +> i.e. `typeof(obj)`, this is not a function call. The two parentheses will > behave like normal and the return value will be used as the operand of the > `typeof` operator. There is **no** `typeof` function. @@ -33,7 +33,7 @@ object. {} Object object new Object() Object object -In the above table *Type* refers to the value, that the `typeof` operator returns. +In the above table *Type* refers to the value that the `typeof` operator returns. As can be clearly seen, this value is anything but consistent. The *Class* refers to the value of the internal `[[Class]]` property of an object.