Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Object to primitive conversion#154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

MykolaSopiha
Copy link
Collaborator

No description provided.

@MykolaSopihaMykolaSopiha changed the titleObject to primitiveObject to primitive conversionJul 25, 2021
Copy link
Collaborator

@tarasyyyktarasyyyk left a comment

Choose a reason for hiding this comment

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

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

@javascript-translate-bot
Copy link
Contributor

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

@UkrainianCitizen
Copy link
Contributor

UkrainianCitizen commentedJul 30, 2021
edited
Loading

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

@UkrainianCitizen
Copy link
Contributor

UkrainianCitizen commentedJul 30, 2021
edited
Loading

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


JavaScriptdoesn't exactly allow to customize how operators work on objects. Unlike some other programming languages, such as Rubyor C++,we can't implement a special object method to handle an addition (or other operators).
JavaScriptне дозволяє налаштувати, як працюють оператори з об’єктами. На відміну від деяких інших мов програмування, таких як Rubyабо C++,ми не можемо реалізувати спеціальний об’єктний метод для обробки додавання (або інших операторів).
Copy link
Contributor

Choose a reason for hiding this comment

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

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


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

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/


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".
Наприклад, ми не можемо зробити об’єкти, що представляють вектори або матриці (або досягнення або що завгодно) та додати їх і очікувати, що "підсумковий" результат буде об’єктом. Автоматично такі архітектурні особливості недоступні.
Copy link
Contributor

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/


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

Choose a reason for hiding this comment

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

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


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. Це дозволить нам зрозуміти, що відбувається у випадку помилок коду, коли така операція відбулася випадково.
Copy link
Contributor

Choose a reason for hiding this comment

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

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


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`), причиною цьому зазвичай є помилка програмування.
Copy link
Contributor

Choose a reason for hiding this comment

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

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


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>ми бачили правила для перетворення чисел, рядків та булевих примітивів. Але ми залишили пробіл для об’єктів. Тепер, оскільки ми знаємо про методи та символи, можемо заповнити його.
Copy link
Contributor

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>, ми бачили правила перетворення чисел, рядків та булевих примітивів. Але ми залишилипрогалину щодо об’єктів. Тепер, оскільки ми знаємо про методи та символи,миможемо заповнитиїї.

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` в булевому контексті. Є лише числові та рядкові конверсії.
Copy link
Contributor

Choose a reason for hiding this comment

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

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

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` в булевому контексті. Є лише числові та рядкові конверсії.
Copy link
Contributor

Choose a reason for hiding this comment

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

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


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

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)`?

@UkrainianCitizen
Copy link
Contributor

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

@tarasyyyk
Copy link
Collaborator

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

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

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

@UkrainianCitizenUkrainianCitizenUkrainianCitizen left review comments

@tarasyyyktarasyyyktarasyyyk approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@MykolaSopiha@javascript-translate-bot@UkrainianCitizen@tarasyyyk

[8]ページ先頭

©2009-2025 Movatter.jp