diff --git a/snippets/fibonacci.md b/snippets/fibonacci.md index 474bba30d..1c47024b7 100644 --- a/snippets/fibonacci.md +++ b/snippets/fibonacci.md @@ -11,5 +11,5 @@ const fibonacci = n => ``` ```js -factorial(6) // 720 +fibonacci(6) // 720 ``` diff --git a/snippets/flattenDepth.md b/snippets/flattenDepth.md index a08563ca5..580f51b94 100644 --- a/snippets/flattenDepth.md +++ b/snippets/flattenDepth.md @@ -14,5 +14,5 @@ const flattenDepth = (arr, depth = 1) => ``` ```js -flatten([1,[2],3,4]) // [1,2,3,4] +flattenDepth([1,[2],3,4]) // [1,2,3,4] ``` diff --git a/snippets/readFileLines.md b/snippets/readFileLines.md index 363132cb0..5568f2268 100644 --- a/snippets/readFileLines.md +++ b/snippets/readFileLines.md @@ -23,12 +23,3 @@ let arr = readFileLines('test.txt') console.log(arr) // ['line1', 'line2', 'line3'] ``` -```js -contents of test.txt : - line1 - line2 - line3 - ___________________________ -let arr = readFileLines('test.txt') -console.log(arr) // // ['line1', 'line2', 'line3'] -``` diff --git a/snippets/sdbmHashAlgorithm.md b/snippets/sdbm.md similarity index 82% rename from snippets/sdbmHashAlgorithm.md rename to snippets/sdbm.md index c68cded64..f9665f33f 100644 --- a/snippets/sdbmHashAlgorithm.md +++ b/snippets/sdbm.md @@ -11,6 +11,9 @@ const sdbm = str => { hashCode = currentVal.charCodeAt(0) + (hashCode << 6) + (hashCode << 16) - hashCode ,0) } -// console.log(sdbm("name")) // -3521204949 -// console.log(sdbm("age")) // 808122783 +``` + +```js +console.log(sdbm("name")) // -3521204949 +console.log(sdbm("age")) // 808122783 ``` diff --git a/snippets/timeTaken.md b/snippets/timeTaken.md index 3ffa14dfe..083405afb 100644 --- a/snippets/timeTaken.md +++ b/snippets/timeTaken.md @@ -13,5 +13,5 @@ const timeTaken = callback => { ```js timeTaken(() => Math.pow(2, 10)) // 1024 -(logged): timeTaken: 0.02099609375ms +// (logged): timeTaken: 0.02099609375ms ``` diff --git a/snippets/tomorrow.md b/snippets/tomorrow.md index 29ba4dae0..d0f902db6 100644 --- a/snippets/tomorrow.md +++ b/snippets/tomorrow.md @@ -5,5 +5,8 @@ Use `new Date()` to get today's date, adding `86400000` of seconds to it(24 hour ```js const tomorrow = () => new Date(new Date().getTime() + 86400000).toISOString().split('T')[0]; -// tomorrow() -> 2017-12-27 (if current date is 2017-12-26) +``` + +```js +tomorrow() // 2017-12-27 (if current date is 2017-12-26) ``` diff --git a/tag_database b/tag_database index 6afffd83c..74e13cd58 100644 --- a/tag_database +++ b/tag_database @@ -107,7 +107,7 @@ round:math runPromisesInSeries:function sample:array scrollToTop:browser -sdbmHashAlgorithm:math +sdbm:utility select:object shallowClone:object shuffle:array