Skip to content

Commit

Permalink
Minor change in resources.md and some rewording in memoization.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sage7will committed Sep 3, 2016
1 parent 258ed79 commit 246f2c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#### Debugging

* [0x](https://www.npmjs.com/package/0x) – Visualize Stack Traces.
* [0x](https://www.npmjs.com/package/0x) – Visualize stack traces.

#### Array

Expand Down
6 changes: 3 additions & 3 deletions workflow/memoization.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Memoization: Cache successive calls.

Just calculate the value of something once, and reuse the value avoiding the cost of recalculate the same value.
Just calculate the value of something once and reuse the value. This avoids the cost of recalculating the same value.

If you need to control of a set of tiny values, you can use an `Map`:
If you need to control a set of small values, you can use a `Map`:

```js
var cache = new Map()
Expand All @@ -14,4 +14,4 @@ var routeName = `${cityOne}${cityTwo}`
if (!cache.has(routeName)) cache.set(routeName, getDistance(cityOne, cityTwo))
```

A little complex but better solution will be control the size of the `Map`, as LRU cache.
A more complex, but better solution, would be to control the size of the `Map`. One example would be to use an LRU cache.

0 comments on commit 246f2c6

Please sign in to comment.