This file contains 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
#!/bin/sh | |
ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint" | |
if [[ ! -x "$ESLINT" ]]; then | |
echo "\t\033[41mPlease install ESlint\033[0m (npm i --save --save-exact --dev eslint)" | |
exit 1 | |
fi | |
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$"| grep -v "node_modules") |
This file contains 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 plumages(birds) { | |
return new Map(birds.map(b => [b.name, plumage(b)])); | |
} | |
function speeds(birds) { | |
return new Map(birds.map(b => [b.name, airSpeedVelocity(b)])); | |
} | |
function plumage(bird) { | |
switch (bird.type) { |
This file contains 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 plumages(birds) { | |
return new Map(birds | |
.map(b => creaetBird(b)) | |
.map(bird => [bird.name, b.plumage]) | |
); | |
} | |
function speeds(birds) { | |
return new Map(birds | |
.map(b => creaetBird(b)) |
This file contains 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
const voyage = {zone: "서인도", length: 10}; | |
const history = [ | |
{zone: "동인도", profit: 5}, | |
{zone: "서인도", profit: 15}, | |
{zone: "중국", profit: -2}, | |
{zone: "서아프리카", profit: 7}, | |
]; | |
const myRating = rating(voyage, history); |