Closed gstark closed 5 years ago
https://github.com/gabeo14/function-junction
don't have rovarspraket yet, so I'll come back and reopen this to do it when I get the chance.
Thanks Gavin
function isVowel(ltr) {
if (
ltr === 'a' ||
ltr === 'e' ||
ltr === 'i' ||
ltr === 'o' ||
ltr === 'u' ||
ltr === 'A' ||
ltr === 'E' ||
ltr === 'I' ||
ltr === 'O' ||
ltr === 'U'
) {
return true
} else {
return false
}
}
can just be
function isVowel(ltr) {
return (
ltr === 'a' ||
ltr === 'e' ||
ltr === 'i' ||
ltr === 'o' ||
ltr === 'u' ||
ltr === 'A' ||
ltr === 'E' ||
ltr === 'I' ||
ltr === 'O' ||
ltr === 'U'
)
}
since
if (condition) {
return true
} else {
return false
}
is the same as
return condition
Your homework was marked: Meets Expectations
“With LASERS” — 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.