Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update 1-js/04-object-basics/09-object-toprimitive/article.md
  • Loading branch information
tarasyyyk authored Jul 27, 2021
commit 79ea62f88a890a003d48906d9dc0fa82f28b9250
1 change: 1 addition & 0 deletions 1-js/04-object-basics/09-object-toprimitive/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ JavaScript не дозволяє налаштувати, як працюють
Наприклад, бінарний плюс `+` може працювати як з рядками (об’єднувати їх), так і з цифрами (додавати їх), тому обидва випадки -- рядки та цифри -- будуть працювати. Отже, якщо бінарний плюс отримує об’єкт як аргумент, він використовує підказку `"default"`, щоб перетворити його.

Comment thread
tarasyyyk marked this conversation as resolved.
Також, якщо об’єкт порівнюється (`==`) з рядком, числом чи символом, тоді незрозуміло, яке порівняння використати, тому використовується підказка `"default"`.

```js
Comment thread
tarasyyyk marked this conversation as resolved.
// бінарний плюс використовує підказку "default"
let total = obj1 + obj2;
Expand Down