GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Object to primitive conversion by MykolaSopiha · Pull Request #154 · javascript-tutorial/uk.javascript.info

Conversation

@MykolaSopiha

@MykolaSopiha MykolaSopiha commented Jul 25, 2021

Copy link
Copy Markdown
Collaborator

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
MykolaSopiha added 2 commits July 24, 2021 20:19
@MykolaSopiha
wip: object to primitive conversion
195233e
@MykolaSopiha
object to primirive
1a10ae9
@javascript-translate-bot javascript-translate-bot added the review needed label Jul 25, 2021
@MykolaSopiha MykolaSopiha changed the title Object to primitive Object to primitive conversion Jul 25, 2021
@MykolaSopiha
fix: object to primirive
7d81121
tarasyyyk
tarasyyyk reviewed Jul 27, 2021
View reviewed changes
Comment thread 1-js/04-object-basics/09-object-toprimitive/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@tarasyyyk
Update 1-js/04-object-basics/09-object-toprimitive/article.md
c2331bc
tarasyyyk
tarasyyyk reviewed Jul 27, 2021
View reviewed changes
Comment thread 1-js/04-object-basics/09-object-toprimitive/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@tarasyyyk
Update 1-js/04-object-basics/09-object-toprimitive/article.md
79ea62f
tarasyyyk
tarasyyyk reviewed Jul 27, 2021
View reviewed changes
Comment thread 1-js/04-object-basics/09-object-toprimitive/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@tarasyyyk
Update 1-js/04-object-basics/09-object-toprimitive/article.md
b571977
tarasyyyk
tarasyyyk reviewed Jul 27, 2021
View reviewed changes
Comment thread 1-js/04-object-basics/09-object-toprimitive/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@tarasyyyk
small fixes
e3c79a0
tarasyyyk
tarasyyyk approved these changes Jul 27, 2021
View reviewed changes

@tarasyyyk tarasyyyk left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Дякую за переклад!
Додав пару нових рядків, щоб номери рядків збігалися з оригінальним текстом.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@javascript-translate-bot javascript-translate-bot added needs +1 and removed review needed labels Jul 27, 2021
@tarasyyyk
tarasyyyk merged commit f2956c5 into javascript-tutorial:master Jul 27, 2021
@javascript-translate-bot javascript-translate-bot mentioned this pull request Jul 27, 2021
Ukrainian Translation Progress #1
Open
@javascript-translate-bot

javascript-translate-bot commented Jul 27, 2021

Copy link
Copy Markdown
Contributor

Thank you 💖 I updated the Progress Issue #1 🎉 🎉 🎉

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@UkrainianCitizen

UkrainianCitizen commented Jul 30, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Еммммммм................. я почав робити рев'ю, а ти замерджив
@tarasyyyk

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@UkrainianCitizen

UkrainianCitizen commented Jul 30, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Там були граматичні, семантичні та помилки перекладу

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

UkrainianCitizen
UkrainianCitizen reviewed Jul 30, 2021
View reviewed changes
Comment thread 1-js/04-object-basics/09-object-toprimitive/article.md
Що відбувається, коли об’єкти додаються `obj1 + obj2`, віднімаються `obj1 - obj2` або друкуються за допомогою `alert(obj)`?

JavaScript doesn't exactly allow 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 an addition (or other operators).
JavaScript не дозволяє налаштувати, як працюють оператори з об’єктами. На відміну від деяких інших мов програмування, таких як Ruby або C++, ми не можемо реалізувати спеціальний об’єктний метод для обробки додавання (або інших операторів).

@UkrainianCitizen UkrainianCitizen Jul 26, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кома перед як не потрібна. Деяких можна забрати. Краще метод об'єкта.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/04-object-basics/09-object-toprimitive/article.md
JavaScript не дозволяє налаштувати, як працюють оператори з об’єктами. На відміну від деяких інших мов програмування, таких як Ruby або C++, ми не можемо реалізувати спеціальний об’єктний метод для обробки додавання (або інших операторів).

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.
У разі таких операцій об’єкти автоматично перетворюються на примітиви, а потім операція здійснюється над цими примітивами та повертає результат у вигляді примітивного значення.

@UkrainianCitizen UkrainianCitizen Jul 26, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
У разі таких операцій об’єкти автоматично перетворюються на примітиви, а потім операція здійснюється над цими примітивами та повертає результат у вигляді примітивного значення.
У разі таких операцій, об’єкти автоматично перетворюються на примітиви, далі операція виконується над цими примітивами, що закінчується поверненням результату як примітивного значення.

https://onlinecorrector.com.ua/uk/%D0%BF%D0%BE%D0%B4%D1%96%D0%B1%D0%BD%D0%B8%D0%B9-%D0%B4%D0%BE-%D1%8F%D0%BA/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/04-object-basics/09-object-toprimitive/article.md
Це важливе обмеження, оскільки результат `obj1 + obj2` не може бути іншим об’єктом!

E.g. we can't make objects representing vectors or matrices (or archievements or whatever), add them and expect a "summed" object as the result. Such architectural feats are automatically "off the board".
Наприклад, ми не можемо зробити об’єкти, що представляють вектори або матриці (або досягнення або що завгодно) та додати їх і очікувати, що "підсумковий" результат буде об’єктом. Автоматично такі архітектурні особливості недоступні.

@UkrainianCitizen UkrainianCitizen Jul 26, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В реченнні немає сенсу, дослівний необдуманий переклад.
Старайтеся перекладати правильно, а не дослівно, будь ласка

Suggested change
Наприклад, ми не можемо зробити об’єкти, що представляють вектори або матриці (або досягнення або що завгодно) та додати їх і очікувати, що "підсумковий" результат буде об’єктом. Автоматично такі архітектурні особливості недоступні.
Наприклад, ми не можемо створити об’єкти, що являють собою вектори або матриці (або досягнення або щось інше), додати їх та очікувати, що результат буде об’єктом. Автоматично такі архітектурні "трюки" недоступні.

Пудсумковий результат - тавтологія
https://onlinecorrector.com.ua/uk/%D0%B1%D1%83%D1%82%D0%B8-%D1%8F%D0%B2%D0%BB%D1%8F%D1%82%D0%B8-%D1%81%D0%BE%D0%B1%D0%BE%D1%8E/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/04-object-basics/09-object-toprimitive/article.md
У цьому розділі ми розглянемо те, як об’єкти перетворюється на примітиви і як налаштувати це.

We have two purposes:
У нас є два цілі:

@UkrainianCitizen UkrainianCitizen Jul 26, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
У нас є два цілі:
У нас є дві цілі:

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/04-object-basics/09-object-toprimitive/article.md

1. It will allow us to understand what's going on in case of coding mistakes, when such an operation happened accidentally.
2. There are exceptions, where such operations are possible and look good. E.g. subtracting or comparing dates (`Date` objects). We'll come across them later.
1. Це дозволить нам зрозуміти, що відбувається у випадку помилок коду, коли така операція відбулася випадково.

@UkrainianCitizen UkrainianCitizen Jul 26, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Це дозволить нам зрозуміти, що відбувається у випадку помилок коду, коли така операція відбулася випадково.
1. Це дозволить нам зрозуміти, що відбувається у випадку неправильно написаного коду, коли така операція відбулася випадково.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/04-object-basics/09-object-toprimitive/article.md
Наприклад, ми не можемо зробити об’єкти, що представляють вектори або матриці (або досягнення або що завгодно) та додати їх і очікувати, що "підсумковий" результат буде об’єктом. Автоматично такі архітектурні особливості недоступні.

So, because we can't do much here, there's no maths with objects in real projects. When it happens, it's usually because of a coding mistake.
Отже, оскільки ми не можемо автоматично за допомогою мови програмування виконувати подібні операції над об’єктами, то в реальних проєктах немає "математики з об’єктами". Коли стаються подібні операції (наприклад, `obj1 + obj2`), причиною цьому зазвичай є помилка програмування.

@UkrainianCitizen UkrainianCitizen Jul 26, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Отже, оскільки ми не можемо автоматично за допомогою мови програмування виконувати подібні операції над об’єктами, то в реальних проєктах немає "математики з об’єктами". Коли стаються подібні операції (наприклад, `obj1 + obj2`), причиною цьому зазвичай є помилка програмування.
Отже, оскільки ми тут вже нічого не можемо зробити, то в реальних проєктах немає "математики з об’єктами". Коли подібне відбувається, то причиною, зазвичай, є помилка програмування.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/04-object-basics/09-object-toprimitive/article.md
## Правила перетворення

In the chapter <info:type-conversions> we've seen the rules for numeric, string and boolean conversions of primitives. But we left a gap for objects. Now, as we know about methods and symbols it becomes possible to fill it.
У розділі <info:type-conversions> ми бачили правила для перетворення чисел, рядків та булевих примітивів. Але ми залишили пробіл для об’єктів. Тепер, оскільки ми знаємо про методи та символи, можемо заповнити його.

@UkrainianCitizen UkrainianCitizen Jul 26, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
У розділі <info:type-conversions> ми бачили правила для перетворення чисел, рядків та булевих примітивів. Але ми залишили пробіл для об’єктів. Тепер, оскільки ми знаємо про методи та символи, можемо заповнити його.
У розділі <info:type-conversions>, ми бачили правила перетворення чисел, рядків та булевих примітивів. Але ми залишили прогалину щодо об’єктів. Тепер, оскільки ми знаємо про методи та символи, ми можемо заповнити її.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/04-object-basics/09-object-toprimitive/article.md
1. All objects are `true` in a boolean context. There are only numeric and string conversions.
2. The numeric conversion happens when we subtract objects or apply mathematical functions. For instance, `Date` objects (to be covered in the chapter <info:date>) can be subtracted, and the result of `date1 - date2` is the time difference between two dates.
3. As for the string conversion -- it usually happens when we output an object like `alert(obj)` and in similar contexts.
1. Всі об’єкти -- це `true` в булевому контексті. Є лише числові та рядкові конверсії.

@UkrainianCitizen UkrainianCitizen Jul 26, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Або коротке тире – або тире —. Ніяких --

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/04-object-basics/09-object-toprimitive/article.md
1. All objects are `true` in a boolean context. There are only numeric and string conversions.
2. The numeric conversion happens when we subtract objects or apply mathematical functions. For instance, `Date` objects (to be covered in the chapter <info:date>) can be subtracted, and the result of `date1 - date2` is the time difference between two dates.
3. As for the string conversion -- it usually happens when we output an object like `alert(obj)` and in similar contexts.
1. Всі об’єкти -- це `true` в булевому контексті. Є лише числові та рядкові конверсії.

@UkrainianCitizen UkrainianCitizen Jul 26, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Краще конверсії чисел та рядків

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/04-object-basics/09-object-toprimitive/article.md
# Перетворення об’єктів в примітиви

What happens when objects are added `obj1 + obj2`, subtracted `obj1 - obj2` or printed using `alert(obj)`?
Що відбувається, коли об’єкти додаються `obj1 + obj2`, віднімаються `obj1 - obj2` або друкуються за допомогою `alert(obj)`?

@UkrainianCitizen UkrainianCitizen Jul 26, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Що відбувається, коли об’єкти додаються `obj1 + obj2`, віднімаються `obj1 - obj2` або друкуються за допомогою `alert(obj)`?
Що відбувається, коли об’єкти додаються(`obj1 + obj2`), віднімаються(`obj1 - obj2`) або друкуються за допомогою `alert(obj)`?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@UkrainianCitizen

UkrainianCitizen commented Jul 30, 2021

Copy link
Copy Markdown
Contributor

І я не закінчив рев'ю

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tarasyyyk

tarasyyyk commented Aug 3, 2021

Copy link
Copy Markdown
Collaborator

Еммммммм................. я почав робити рев'ю, а ти замерджив
@tarasyyyk

Незнав, що Ви робите рев’ю.
Коли закінчите, напишіть коментар і я внесу зміни. Дякую.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tarasyyyk tarasyyyk tarasyyyk approved these changes
+1 more reviewer
@UkrainianCitizen UkrainianCitizen UkrainianCitizen left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

needs +1

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@MykolaSopiha @javascript-translate-bot @UkrainianCitizen @tarasyyyk
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.