INTERVIEW - JS
Functional programming
pass functions as parameters to other functions
immutable, predictable
Higher-order function (HOF)
extendedFunction = HOF(basic function)
parameters share scope
// ES5
function add(x){
return function(y){
return y + x;
};
}
// ES6
const add = x => y => y + x;
// usage
const add2 = add(2);// returns [inner function] where x = 2
add2(4); // returns 6: exec inner with y = 4, x = 2
add(8)(7); // 15map is a HOF
Middleware
HOF
authentication, logging, statistics
redux middleware = 介於dispatch(action) -> reducer之間
Redux-Thunk
redux action = return object
thunk action = return function

https://medium.com/@User3141592/understanding-the-redux-thunk-source-code-b3f8b930faf6
Webpack
Webpack is a build tool that puts all of your assets, including Javascript, images, fonts, and CSS, in a dependency graph.
https://blog.andrewray.me/webpack-when-to-use-and-why/
Babel
turn ES6/7 & JSX to ES5
HOC
Async
Last updated
Was this helpful?