Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/en/core/semicolon.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/en/core/undefined.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion doc/en/function/arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions doc/en/function/closures.md
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down Expand Up @@ -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++) {
Expand Down
2 changes: 1 addition & 1 deletion doc/en/function/constructors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions doc/en/function/scopes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions doc/en/intro/index.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions doc/en/object/forinloop.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand All @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion doc/en/object/prototype.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions doc/en/other/timeouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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(){
Expand Down
2 changes: 1 addition & 1 deletion doc/en/types/casting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions doc/en/types/typeof.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Expand Down