Closed gstark closed 6 years ago
https://github.com/AllanSeitz/function-junction.git
i really enjoyed this, i was impressed with how well i could type the functions out from memory
Very nice.
Do you understand how Math.max(...array)
works -- We haven't covered this in class so I want to make sure you understand that idiom if you are going to use it.
Also
if (
x === 'a' ||
x === 'A' ||
x === 'e' ||
x === 'E' ||
x === 'i' ||
x === 'I' ||
x === 'o' ||
x === 'O' ||
x === 'u' ||
x === 'U'
) {
return true
} else {
return false
}
Could be just
return (
x === 'a' ||
x === 'A' ||
x === 'e' ||
x === 'E' ||
x === 'i' ||
x === 'I' ||
x === 'o' ||
x === 'O' ||
x === 'u' ||
x === 'U'
)
Since if you have
if (condition) {
return true
} else {
return false
}
it is the same as
return condition
Your homework is: Meets Expectations
my understanding is Math.max(...array) will spread the array then return the largest number above in the array, is that correct? On Thursday, October 4, 2018, 8:21:51 AM EDT, Gavin Stark notifications@github.com wrote:
Very nice.
Do you understand how Math.max(...array) works -- We haven't covered this in class so I want to make sure you understand that idiom if you are going to use it.
Also if ( x === 'a' || x === 'A' || x === 'e' || x === 'E' || x === 'i' || x === 'I' || x === 'o' || x === 'O' || x === 'u' || x === 'U' ) { return true } else { return false }
Could be just return ( x === 'a' || x === 'A' || x === 'e' || x === 'E' || x === 'i' || x === 'I' || x === 'o' || x === 'O' || x === 'u' || x === 'U' )
Since if you have if (condition) { return true } else { return false }
it is the same as return condition
— You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
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.