Skip to content

Commit d0789c8

Browse files
authored
Merge pull request #2 from javascript-tutorial/sync-19223ae7
Sync with upstream @ 19223ae
2 parents 37c95ed + 1331ae0 commit d0789c8

File tree

136 files changed

+704
-1060
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+704
-1060
lines changed

1-js/01-getting-started/1-intro/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The engine applies optimizations at each step of the process. It even watches th
4545

4646
Modern JavaScript is a "safe" programming language. It does not provide low-level access to memory or CPU, because it was initially created for browsers which do not require it.
4747

48-
Javascript's capabilities greatly depend on the environment it's running in. For instance, [Node.JS](https://wikipedia.org/wiki/Node.js) supports functions that allow JavaScript to read/write arbitrary files, perform network requests, etc.
48+
JavaScript's capabilities greatly depend on the environment it's running in. For instance, [Node.js](https://wikipedia.org/wiki/Node.js) supports functions that allow JavaScript to read/write arbitrary files, perform network requests, etc.
4949

5050
In-browser JavaScript can do everything related to webpage manipulation, interaction with the user, and the webserver.
5151

@@ -88,7 +88,7 @@ There are at least *three* great things about JavaScript:
8888
+ Simple things are done simply.
8989
+ Support by all major browsers and enabled by default.
9090
```
91-
Javascript is the only browser technology that combines these three things.
91+
JavaScript is the only browser technology that combines these three things.
9292

9393
That's what makes JavaScript unique. That's why it's the most widespread tool for creating browser interfaces.
9494

1-js/01-getting-started/3-devtools/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Now `key:Cmd+Opt+C` can toggle the console. Also, note that the new top menu ite
5454

5555
Usually, when we put a line of code into the console, and then press `key:Enter`, it executes.
5656

57-
To insert multiple line, press `key:Shift+Enter`.
57+
To insert multiple lines, press `key:Shift+Enter`.
5858

5959
## Summary
6060

1-js/02-first-steps/01-hello-world/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Hello, world!
22

3-
The tutorial that you're reading is about core JavaScript, which is platform-independent. Later on, you'll learn about Node.JS and other platforms that use it.
3+
The tutorial that you're reading is about core JavaScript, which is platform-independent. Later on, you'll learn about Node.js and other platforms that use it.
44

5-
But we need a working environment to run our scripts and, since this book is online, the browser is a good choice. We'll keep the amount of browser-specific commands (like `alert`) to a minimum so that you don't spend time on them if you plan to concentrate on another environment (like Node.JS). We'll focus on JavaScript in the browser in the [next part](/ui) of the tutorial.
5+
But we need a working environment to run our scripts and, since this book is online, the browser is a good choice. We'll keep the amount of browser-specific commands (like `alert`) to a minimum so that you don't spend time on them if you plan to concentrate on another environment (like Node.js). We'll focus on JavaScript in the browser in the [next part](/ui) of the tutorial.
66

7-
So first, let's see how we attach a script to a webpage. For server-side environments (like Node.JS), you can execute the script with a command like `"node my.js"`.
7+
So first, let's see how we attach a script to a webpage. For server-side environments (like Node.js), you can execute the script with a command like `"node my.js"`.
88

99

1010
## The "script" tag

1-js/02-first-steps/04-variables/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ let userName;
157157
let test123;
158158
```
159159
160-
When the name contains multiple words, [camelCase](https://en.wikipedia.org/wiki/CamelCase) is commonly used. That is: words go one after another, each word starting with a capital letter: `myVeryLongName`.
160+
When the name contains multiple words, [camelCase](https://en.wikipedia.org/wiki/CamelCase) is commonly used. That is: words go one after another, each word except first starting with a capital letter: `myVeryLongName`.
161161
162162
What's interesting -- the dollar sign `'$'` and the underscore `'_'` can also be used in names. They are regular symbols, just like letters, without any special meaning.
163163

1-js/02-first-steps/06-type-conversions/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Type Conversions
22

3-
Most of the time, operators and functions automatically convert the values given to them to the right type. This is called "type conversion".
3+
Most of the time, operators and functions automatically convert the values given to them to the right type.
44

55
For example, `alert` automatically converts any value to a string to show it. Mathematical operations convert values to numbers.
66

1-js/02-first-steps/14-function-basics/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ These examples assume common meanings of prefixes. What they mean for you is det
382382
```smart header="Ultrashort function names"
383383
Functions that are used *very often* sometimes have ultrashort names.
384384

385-
For example, the [jQuery](http://jquery.com) framework defines a function with `$`. The [LoDash](http://lodash.com/) library has its core function named `_`.
385+
For example, the [jQuery](http://jquery.com) framework defines a function with `$`. The [Lodash](http://lodash.com/) library has its core function named `_`.
386386

387387
These are exceptions. Generally functions names should be concise and descriptive.
388388
```

1-js/03-code-quality/02-coding-style/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Most linters are integrated with many popular editors: just enable the plugin in
287287

288288
For instance, for ESLint you should do the following:
289289

290-
1. Install [Node.JS](https://nodejs.org/).
290+
1. Install [Node.js](https://nodejs.org/).
291291
2. Install ESLint with the command `npm install -g eslint` (npm is a JavaScript package installer).
292292
3. Create a config file named `.eslintrc` in the root of your JavaScript project (in the folder that contains all your files).
293293
4. Install/enable the plugin for your editor that integrates with ESLint. The majority of editors have one.

1-js/05-data-types/01-primitives-methods/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The solution looks a little bit awkward, but here it is:
4848

4949
1. Primitives are still primitive. A single value, as desired.
5050
2. The language allows access to methods and properties of strings, numbers, booleans and symbols.
51-
3. When this happens, a special "object wrapper" is created that provides the extra functionality, and then is destroyed.
51+
3. When this happens, a special "object wrapper" that provides the extra functionality is created, and then is destroyed.
5252

5353
The "object wrappers" are different for each primitive type and are called: `String`, `Number`, `Boolean` and `Symbol`. Thus, they provide different sets of methods.
5454

1-js/05-data-types/02-number/9-random-int-min-max/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Any number from the interval `min..max` must appear with the same probability.
1212
Examples of its work:
1313

1414
```js
15-
alert( random(1, 5) ); // 1
16-
alert( random(1, 5) ); // 3
17-
alert( random(1, 5) ); // 5
15+
alert( randomInteger(1, 5) ); // 1
16+
alert( randomInteger(1, 5) ); // 3
17+
alert( randomInteger(1, 5) ); // 5
1818
```
1919

2020
You can use the solution of the [previous task](info:task/random-min-max) as the base.

1-js/05-data-types/04-array/10-maximal-subarray/solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ For instance, for `[-1, 2, 3, -9, 11]`:
2929
-9
3030
-9 + 11
3131

32-
// Starting from -11
33-
-11
32+
// Starting from 11
33+
11
3434
```
3535

3636
The code is actually a nested loop: the external loop over array elements, and the internal counts subsums starting with the current element.

0 commit comments

Comments
 (0)