GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Methods of primitives by stevermeister · Pull Request #10 · javascript-tutorial/uk.javascript.info Conversation
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was an error while loading. Please reload this page.
| @@ -1,22 +1,22 @@ | |||
| # Methods of primitives | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Article title not translated
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| - 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. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Remove this line "Is a value of a primitive type."
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| З іншого боку, використання тих же самих функцій `String / Number / Boolean` без` new` є абсолютно розумною і корисною річчю. Вони перетворюють значення у відповідний тип: до рядка, числа або булевого (примітиву). | ||
|
|
||
| Наприклад, це цілком справедливо: | ||
| For example, this is entirely valid: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Remove "For example, this is entirely valid:"
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
was not sure about good translation in this place, maybe you have ideas?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"Наприклад, такий вираз цілком правильний:"
or
"Наприклад, це/так цілком правильно:"
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Наприклад, це цілком справедливо: | ||
| For example, this is entirely valid: | ||
| ```js | ||
| let num = Number("123"); // convert a string to number |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Comment also can be translated
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ```` | ||
|
|
||
| ## Summary | ||
| ## Виводи |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It's better to translate "Summary" as "Висновки" or "Підсумки"
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| З іншого боку, використання тих же самих функцій `String / Number / Boolean` без` new` є абсолютно розумною і корисною річчю. Вони перетворюють значення у відповідний тип: до рядка, числа або булевого (примітиву). | ||
|
|
||
| Наприклад, це цілком справедливо: | ||
| For example, this is entirely valid: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"Наприклад, такий вираз цілком правильний:"
or
"Наприклад, це/так цілком правильно:"
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -126,7 +126,7 @@ let num = Number("123"); // convert a string to number | |||
| alert(null.test); // error | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
translate comment: // помилка
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Спробуйте запустити: | ||
|
|
||
| ```js run | ||
| let str = "Hello"; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
let str = "Привіт";
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Ви можете отримати два результати: | ||
| 1. `undefined` | ||
| 2. An error. | ||
| 2. помилка. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Розглянемо наступний код: | ||
|
|
||
| ```js | ||
| let str = "Hello"; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
let str = "Привіт";
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Але за все потрібно платити! | ||
|
|
||
| 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 намагається оптимізувати їх для зменшення додаткового навантаження. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Об'єкти "важчі" за примітиви.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Ось як він працює: | ||
|
|
||
| ```js run | ||
| let str = "Hello"; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
let str = "Привіт";
...
// ПРИВІТ
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| 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 ()`. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
toUpperCase() - without space
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| if (zero) { // zero is true, because it's an object | ||
| if (zero) { // zero є true, тому що це об'єкт | ||
| alert( "zero is truthy?!?" ); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
alert( "чи zero є true?!?" );
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| 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` є абсолютно розумною і корисною річчю. Вони перетворюють значення у відповідний тип: до рядка, числа або булевого (примітиву). |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
remove space before new
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@tarasyyyk thank you for detailed review! all places were updated accordingly to the comments |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@stevermeister found some fresh changes to English version: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@tarasyyyk yes, sure and could you please update untranslated parts of this repo with actual en origin? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Adding some mention of implicit `<tbody>` element. Comes up later in Modifying the Document task #10 solution.
|
Thanks for your contribution! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I've put up a pull request to add @stevermeister! 🎉 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.