以下语句在js中的作用是什么
What does following statement does in js
我是 JS 新手,使用 react+redux 框架,我在 reducer 代码中有如下代码。
export const operationState = (state = someState, action = {}) => {
//some case handler
}
请帮助我理解这将转化为什么。
它导出一个名为 operationState
的函数,带有参数 state 和 action,如果在调用 operationState()
时没有传入任何参数,则默认为 someState
和 {}
我是 JS 新手,使用 react+redux 框架,我在 reducer 代码中有如下代码。
export const operationState = (state = someState, action = {}) => {
//some case handler
}
请帮助我理解这将转化为什么。
它导出一个名为 operationState
的函数,带有参数 state 和 action,如果在调用 operationState()
时没有传入任何参数,则默认为 someState
和 {}