mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-10 11:09:43 +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
|
||||
and results, which are returned if found inside cache */
|
||||
and results, which are returned if found inside cache */
|
||||
const memoize = (fn) => {
|
||||
const cache = new Map();
|
||||
|
||||
@ -13,7 +13,7 @@ const memoize = (fn) => {
|
||||
};
|
||||
|
||||
/* 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) => {
|
||||
if (n === 0 || n === 1) return n;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user