1. What is the single responsibility principle
and how does it apply to components??
Components should be limited to a single ‘thing’.
2. What does it mean to build a ‘static’ version of your application?
It means to build out a skeleton that renders your page, without worrying about the functionality at that phase.
3. Once you have a static application, what do you need to add?
We’d need to add the functionality of the page to make it interactive.
4. What are the three questions you can ask to determine if something is state?
Is it passed in from a parent via props? If so, it probably isn’t state.
Does it remain unchanged over time? If so, it probably isn’t state.
Can you compute it based on any other state or props in your component? If so, it isn’t state.
5. How can you identify where state needs to live?
1. What is a “higher-order function”?
It’s a function that accepts other functions as parameters and may return a function.
2. Explore the greaterThan
function as defined in the reading. In your own words, what is line 2 of this function doing?
Line 2 is
3. Explain how either map
or reduce
operates, with regards to higher-order functions.?
map
accepts an array as an argument, and uses a callback function to traverse through each index, do some code with each index, and return a new array.