Skip to content

Commit

Permalink
Merge pull request javascript-tutorial#133 from seancwall/patch-3
Browse files Browse the repository at this point in the history
Fix spelling mistake 'substract'
  • Loading branch information
iliakan authored Aug 9, 2017
2 parents 7ce5a24 + c75e07d commit 2fd1292
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 1-js/04-object-basics/05-object-toprimitive/article.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Object to primitive conversion

What happens when objects are added `obj1 + obj2`, substracted `obj1 - obj2` or printed using `alert(obj)`?
What happens when objects are added `obj1 + obj2`, subtracted `obj1 - obj2` or printed using `alert(obj)`?

There are special methods in objects that do the conversion.

Expand All @@ -11,7 +11,7 @@ In the chapter <info:type-conversions> we've seen the rules for numeric, string

For objects, there's no to-boolean conversion, because all objects are `true` in a boolean context. So there are only string and numeric conversions.

The numeric conversion happens when we substract objects or apply mathematical functions. For instance, `Date` objects (to be covered in the chapter <info:date>) can be substracted, and the result of `date1 - date2` is the time difference between two dates.
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.

As for the string conversion -- it usually happens when we output an object like `alert(obj)` and in similar contexts.

Expand Down

0 comments on commit 2fd1292

Please sign in to comment.