Skip to content

Commit

Permalink
Typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
edysegura authored Aug 31, 2016
1 parent 00488ea commit 36b480b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions date/timestamp.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ Normally for create timestamps you have two ways:
- `Date.now()`
- `new Date().getTime()`

Althought `Date.now()` and `new Date()` have the same behavior, `Date.now()` is faster because you are not allocating and object and then calling the method of the object.
Althought `Date.now()` and `new Date()` have the same behavior, `Date.now()` is faster because you are not allocating an object and then calling the method of the object.

This is specially remarkable when you make sucesive calls (for example, when you append timestamps in logs).

Another thing to be considered is the fact that, when you create a `new Date()` you are linking a moment of the time with the object. Sucesive calls to `.getTime()` have the same output.
Another thing to be considered is the fact that, when you create a `new Date()` you are linking a moment of the time with the object. Successive calls to `.getTime()` have the same output.

```js
var time = new Date()
Expand Down

0 comments on commit 36b480b

Please sign in to comment.