This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function list(names){ | |
const arrayLen = names.length | |
return names.reduce((previousValue, currentValue, currentIndex)=>{ | |
if(currentIndex === arrayLen-1) | |
return previousValue+currentValue.name | |
if(currentIndex === arrayLen-2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
ACL: 'ACL', | |
BIND: 'BIND', | |
CHECKOUT: 'CHECKOUT', | |
CONNECT: 'CONNECT', | |
COPY: 'COPY', | |
DELETE: 'DELETE', | |
GET: 'GET', | |
HEAD: 'HEAD', | |
LINK: 'LINK', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
Continue: 100, | |
SwitchingProtocols: 101, | |
Processing: 102, | |
EarlyHints: 103, | |
OK: 200, | |
Created: 201, | |
Accepted: 202, | |
NonAuthoritativeInformation: 203, | |
NoContent: 204, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************ | |
Concurrent Merge Sort | |
using goroutine and channel only | |
**************/ | |
package main | |
import "fmt" | |
func Merge(left, right [] int) [] int{ | |
merged := make([] int, 0, len(left) + len(right)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"lint" : "eslint ./", | |
"lint:staged": "eslint $(git diff --cached --name-only | grep -E '\\.(js)$')", | |
"lint:fix": "eslint . --fix", | |
"prettier": "prettier --write '**/*.{js,json,md}'", | |
"prettier:check": "prettier --check '**/*.{js,json,md}'", | |
"prettier-check:staged": "prettier --check $(git diff --cached --name-only | grep -E '\\.(js|json|md)$')" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (...args) => { | |
const stack = Error().stack | |
let lines = stack.split('\n').slice(2, 3).join('').trim() | |
const d = new Date(); | |
console.log(formatDate(d), '::App::', ...args, '::', lines) |