replace
This commit is contained in:
parent
e2443e8de6
commit
75e30539ef
73 changed files with 195 additions and 195 deletions
|
@ -54,7 +54,7 @@ Should look like this:
|
|||
|
||||

|
||||
|
||||
A *breakpoint* is a point of code where the debugger will automatically pause the Javascript execution.
|
||||
A *breakpoint* is a point of code where the debugger will automatically pause the JavaScript execution.
|
||||
|
||||
While the code is paused, we can examine current variables, execute commands in the console etc. That is -- debug it.
|
||||
|
||||
|
@ -128,7 +128,7 @@ There are buttons for it at the right-top:
|
|||
The execution has resumed, reached another breakpoint inside `say()` and paused there. Take a look at the "Call stack" at the right. It has increased by one more call. We're inside `say()` now.
|
||||
|
||||
<span class="devtools" style="background-position:-137px -76px"></span> -- make a step (run the next command), but *not go into the function*, hotkey `key:F10`.
|
||||
: If we click it now, `alert` will be shown. The important thing is that if `alert` were not native, but a Javascript function, then the execution would "step over it", skipping the function internals.
|
||||
: If we click it now, `alert` will be shown. The important thing is that if `alert` were not native, but a JavaScript function, then the execution would "step over it", skipping the function internals.
|
||||
|
||||
<span class="devtools" style="background-position:-72px -76px"></span> -- make a step, hotkey `key:F11`.
|
||||
: The same as the previous one, but "steps in" nested functions. Clicking this will step through all script actions one by one.
|
||||
|
|
|
@ -258,7 +258,7 @@ There are many open style guides, so there we could just accept the one we like
|
|||
|
||||
There exist more there in the wild.
|
||||
|
||||
As you become more mature in Javascript programming, you might want to read them all to pick up the common principles.
|
||||
As you become more mature in JavaScript programming, you might want to read them all to pick up the common principles.
|
||||
|
||||
## Style checkers
|
||||
|
||||
|
@ -280,7 +280,7 @@ Here are simple steps to start using it:
|
|||
|
||||
1. Install [Node.JS](https://nodejs.org/), necessary to run them.
|
||||
2. Install eslint: `npm i -g eslint` (npm is Node.JS package installer).
|
||||
3. Create a config file `.eslintrc` in your Javascript project (the dot at the start is mandatory).
|
||||
3. Create a config file `.eslintrc` in your JavaScript project (the dot at the start is mandatory).
|
||||
|
||||
An example of `.eslintrc`:
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ For instance, for ESLint you should do the following:
|
|||
|
||||
1. Install Node.JS (can take from the <http://nodejs.org>).
|
||||
2. Install ESLint with the command `npm install -g eslint`.
|
||||
3. Create a config file named `.eslintrc` in the root of your Javascript project (in the folder that contains all your files).
|
||||
3. Create a config file named `.eslintrc` in the root of your JavaScript project (in the folder that contains all your files).
|
||||
|
||||
Here's an example of `.eslintrc`:
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ Enough words. Let's see the example.
|
|||
|
||||
Let's say we want to make a function `pow(x, n)` that raises `x` to an integer power `n`. We assume that `n≥0`.
|
||||
|
||||
That task is quite simple, there's even a `**` operator in Javascript that can do that, but here we concentrate not on the function itself, but on the development flow, that can be applied to more complex tasks as well.
|
||||
That task is quite simple, there's even a `**` operator in JavaScript that can do that, but here we concentrate not on the function itself, but on the development flow, that can be applied to more complex tasks as well.
|
||||
|
||||
Before creating the code of `pow`, we can imagine what the function should do and describe it using BDD.
|
||||
|
||||
|
@ -304,7 +304,7 @@ The basic functionality of `pow` is complete. The first iteration of the develop
|
|||
|
||||
As it was said, the function `pow(x, n)` is meant to work with positive integer values `n`.
|
||||
|
||||
To indicate a mathematical error, Javascript functions usually return `NaN`. Let's do the same for invalid values of `n`.
|
||||
To indicate a mathematical error, JavaScript functions usually return `NaN`. Let's do the same for invalid values of `n`.
|
||||
|
||||
Let's first add the behavior to the spec(!):
|
||||
|
||||
|
@ -408,4 +408,4 @@ In real life that's sometimes not that easy. Sometimes it's difficult to write a
|
|||
|
||||
Later in the tutorial you will meet many tasks with tests baked-in. So you will more practical examples.
|
||||
|
||||
Writing tests requires good Javascript knowledge. But we're just starting to learn it. So, to settle down everything, as of now you're not required to write tests, but you should already be able to read them even if they are a little bit more complex than in this chapter.
|
||||
Writing tests requires good JavaScript knowledge. But we're just starting to learn it. So, to settle down everything, as of now you're not required to write tests, but you should already be able to read them even if they are a little bit more complex than in this chapter.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue