mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-13 06:23:00 +08:00
removed trailing spaces
This commit is contained in:
parent
0bc45ea5a5
commit
7cb08f873a
@ -1,5 +1,5 @@
|
|||||||
/* memoize function use a Map to store function arguments
|
/* memoize function use a Map to store function arguments
|
||||||
and results, which are returned if found inside cache */
|
and results, which are returned if found inside cache */
|
||||||
const memoize = (fn) => {
|
const memoize = (fn) => {
|
||||||
const cache = new Map();
|
const cache = new Map();
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ const memoize = (fn) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* fibonacci function decorated with the memoize function, every call
|
/* fibonacci function decorated with the memoize function, every call
|
||||||
will first pass through the cache before it's computed */
|
will first pass through the cache before it's computed */
|
||||||
const fibonacci = memoize((n) => {
|
const fibonacci = memoize((n) => {
|
||||||
if (n === 0 || n === 1) return n;
|
if (n === 0 || n === 1) return n;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user