Methods of primitives by stevermeister · Pull Request #10 · javascript-tutorial/uk.javascript.info
Repository navigation
Methods of primitives - #10
Merged
tarasyyyk merged 7 commits into javascript-tutorial:master from stevermeister:translation May 9, 2019
Merged
Methods of primitives #10 tarasyyyk merged 7 commits into javascript-tutorial:master from stevermeister:translation
Conversation
stevermeister commented May 8, 2019
Copy link Copy Markdown
Contributor
No description provided.
stevermeister added 3 commits May 8, 2019 10:26
first try
2bf4a57
cleanup + task translation
0bf5087
grammar cleanup
471412a
CLAassistant commented May 8, 2019 · edited Loading
Copy link Copy Markdown
|
|
View reviewed changes
tarasyyyk left a comment
Copy link Copy Markdown
Collaborator
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more .
@stevermeister you did a great work. I found some small remarks which need to be resolved before merging.
Comment thread 1-js/05-data-types/01-primitives-methods/article.mdOutdated
| @@ -1,22 +1,22 @@ | ||
| # Methods of primitives |
Outdated
|
|
||
| - Is a value of a primitive type. | ||
| - There are 6 primitive types : `string`, `number`, `boolean`, `symbol`, `null` and `undefined`. | ||
| - є Is a value of a primitive type. |
Outdated
| З іншого боку, використання тих же самих функцій `String / Number / Boolean` без` new` є абсолютно розумною і корисною річчю. Вони перетворюють значення у відповідний тип: до рядка, числа або булевого (примітиву). | ||
|
|
||
| Наприклад, це цілком справедливо: | ||
| For example, this is entirely valid: |
Outdated
| Наприклад, це цілком справедливо: | ||
| For example, this is entirely valid: | ||
| ```js | ||
| let num = Number("123"); // convert a string to number |
Outdated
| ```` | ||
|
|
||
| ## Summary | ||
| ## Виводи |
cleanup
127a02d
tarasyyyk
reviewed
May 9, 2019
View reviewed changes
Comment thread 1-js/05-data-types/01-primitives-methods/article.md
Outdated
| З іншого боку, використання тих же самих функцій `String / Number / Boolean` без` new` є абсолютно розумною і корисною річчю. Вони перетворюють значення у відповідний тип: до рядка, числа або булевого (примітиву). | ||
|
|
||
| Наприклад, це цілком справедливо: | ||
| For example, this is entirely valid: |
Outdated
| @@ -126,7 +126,7 @@ let num = Number("123"); // convert a string to number | ||
| alert(null.test); // error |
Outdated
| Спробуйте запустити : | ||
|
|
||
| ```js run | ||
| let str = "Hello"; |
Outdated
| Ви можете отримати два результати : | ||
| 1. `undefined` | ||
| 2. An error . | ||
| 2. помилка . |
Outdated
| Розглянемо наступний код : | ||
|
|
||
| ```js | ||
| let str = "Hello"; |
Outdated
| Але за все потрібно платити ! | ||
|
|
||
| Objects are "heavier" than primitives. They require additional resources to support the internal machinery. But as properties and methods are very useful in programming, JavaScript engines try to optimize them to reduce the additional burden . | ||
| Об'єкти "важче", ніж примітиви. Вони вимагають додаткових ресурсів для підтримки внутрішньої обробки. Але, оскільки властивості і методи дуже корисні в програмуванні, двигун JavaScript намагається оптимізувати їх для зменшення додаткового навантаження . |
Outdated
| Ось як він працює : | ||
|
|
||
| ```js run | ||
| let str = "Hello"; |
Outdated
| 1. The string `str` is a primitive. So in the moment of accessing its property, a special object is created that knows the value of the string, and has useful methods, like `toUpperCase()`. | ||
| 2. That method runs and returns a new string (shown by `alert`). | ||
| 3. The special object is destroyed, leaving the primitive `str` alone . | ||
| 1. Рядок `str` є примітивом. Тому під час звернення до його властивості створюється спеціальний об'єкт, який знає значення рядка і має корисні методи, такі як `toUpperCase ()`. |
Outdated
|
|
||
| if (zero) { // zero is true, because it's an object | ||
| if (zero) { // zero є true, тому що це об'єкт | ||
| alert( "zero is truthy?!?" ); |
Outdated
|
|
||
| On the other hand, using the same functions `String/Number/Boolean` without `new` is a totally sane and useful thing. They convert a value to the corresponding type: to a string, a number, or a boolean (primitive). | ||
|
|
||
| З іншого боку, використання тих же самих функцій `String / Number / Boolean` без` new` є абсолютно розумною і корисною річчю. Вони перетворюють значення у відповідний тип: до рядка, числа або булевого (примітиву). |
cleanup after review
4bc3284
stevermeister commented May 9, 2019
Copy link Copy Markdown
Contributor
Author
|
@tarasyyyk thank you for detailed review! all places were updated accordingly to the comments |
small language correction
3d51eff
small language corrections
3403c98
tarasyyyk
merged commit 96163a4
into
javascript-tutorial : master
May 9, 2019
tarasyyyk commented May 9, 2019
Copy link Copy Markdown
Collaborator
|
@stevermeister found some fresh changes to English version: |
stevermeister commented May 9, 2019 · edited Loading
Copy link Copy Markdown
Contributor
Author
|
@tarasyyyk yes, sure and could you please update untranslated parts of this repo with actual en origin? |
Update article.md
580221f
Adding some mention of implicit `<tbody>` element. Comes up later in Modifying the Document task #10 solution.
tarasyyyk commented Mar 6, 2020
Copy link Copy Markdown
Collaborator
|
Thanks for your contribution! |
Bot
mentioned this pull request Mar 6, 2020 docs: add stevermeister as a contributor #68 Merged
allcontributors
Bot
commented
Mar 6, 2020
Copy link Copy Markdown
Contributor
|
I've put up a pull request to add @stevermeister ! 🎉 |