Skip to content
Open
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 1-js/04-object-basics/09-object-toprimitive/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

What happens when objects are added `obj1 + obj2`, subtracted `obj1 - obj2` or printed using `alert(obj)`?

JavaScript doesn't allow you to customize how operators work on objects. Unlike some other programming languages, such as Ruby or C++, we can't implement a special object method to handle addition (or other operators).
JavaScript doesn't allow you to customize how operators work on objects. Unlike some other programming languages, such as Ruby or C++, we can't implement a special object method to handle addition (or other operations).

In case of such operations, objects are auto-converted to primitives, and then the operation is carried out over these primitives and results in a primitive value.

Expand Down
2 changes: 1 addition & 1 deletion 1-js/06-advanced-functions/03-closure/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Rectangles on the right-hand side demonstrate how the global Lexical Environment
- Initially, they are in the "Uninitialized" state. That's a special internal state, it means that the engine knows about the variable, but it cannot be referenced until it has been declared with `let`. It's almost the same as if the variable didn't exist.
2. Then `let phrase` definition appears. There's no assignment yet, so its value is `undefined`. We can use the variable from this point forward.
3. `phrase` is assigned a value.
4. `phrase` changes the value.
4. The value of `phrase` is changed.

Everything looks simple for now, right?

Expand Down
2 changes: 1 addition & 1 deletion 2-ui/3-event-details/7-keyboard-events/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Try different key combinations in the text field.

## Keydown and keyup

The `keydown` events happens when a key is pressed down, and then `keyup` -- when it's released.
The `keydown` event happens when a key is pressed down, and then `keyup` -- when it's released.

### event.code and event.key

Expand Down
15 changes: 9 additions & 6 deletions 2-ui/4-forms-controls/1-form-elements/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ document.forms.my; // the form with name="my"
document.forms[0]; // the first form in the document
```

When we have a form, then any element is available in the named collection `form.elements`.
When we have a form, then all control elements within the `<form>` are available in the named collection `form.elements`.

For instance:

Expand Down Expand Up @@ -75,13 +75,13 @@ For instance:
</form>

<script>
alert(form.elements.login); // <input name="login">
alert(form.elements.login); // [object HTMLInputElement]

*!*
let fieldset = form.elements.userFields;
alert(fieldset); // HTMLFieldSetElement
alert(fieldset); // [object HTMLFieldSetElement]

// we can get the input by name both from the form and from the fieldset
// we can get the <input> by name both from the form and from the fieldset
alert(fieldset.elements.login == form.elements.login); // true
*/!*
</script>
Expand Down Expand Up @@ -110,7 +110,7 @@ That's easy to see in an example:

// form.elements updated the name:
alert(form.elements.login); // undefined
alert(form.elements.username); // input
alert(form.elements.username); // [object HTMLInputElement]

*!*
// form allows both names: the new one and the old one
Expand Down Expand Up @@ -144,7 +144,7 @@ For instance:
let login = form.login;

// element -> form
alert(login.form); // HTMLFormElement
alert(login.form); // [object HTMLFormElement]
*/!*
</script>
```
Expand Down Expand Up @@ -269,6 +269,9 @@ Option elements have properties:
`option.index`
: The number of the option among the others in its `<select>`.

`option.value`
: Value of the option.

`option.text`
: Text content of the option (seen by the visitor).

Expand Down