Closed gstark closed 6 years ago
nicely done
This can be refactored:
let isVowel = string => {
if (
string === 'a' ||
string === 'e' ||
string === 'i' ||
string === 'o' ||
string === 'u' ||
string === 'y' ||
string === 'A' ||
string === 'E' ||
string === 'I' ||
string === 'O' ||
string === 'U' ||
string === 'Y'
) {
return true
} else {
return false
}
}
Could just be
let isVowel = string => {
return (
string === 'a' ||
string === 'e' ||
string === 'i' ||
string === 'o' ||
string === 'u' ||
string === 'y' ||
string === 'A' ||
string === 'E' ||
string === 'I' ||
string === 'O' ||
string === 'U' ||
string === 'Y'
)
}
Your homework was marked: Meets Expectations
“Yas” — via Jason L Perry
Objectives
After completing this assignment, you should be able to:
Requirements
hub clone function-junction
cd function-junction
yarn install
(or justyarn
for short)code .
yarn test
src/functions.test.js
and work on functions until tests pass.Explorer Mode
Adventure Mode
String.reverse()
orArray.max()
to solve these problems, try implementing them from scratch.Epic Mode
sum
andmax
functions to take arrays instead of numbers and update the tests so they pass.for
loop or awhile
loop, convert it to use amap
,filter
orreduce
.Additional Resources
Reference the documentation on MDN to find what kind of helpful functions might already be on
Array
andString
in JavaScript.