我一直在阅读一堆react代码,我看到这样的东西,我不明白:
handleChange = field => e => {
e.preventDefault();
/// Do something here
}
Run Code Online (Sandbox Code Playgroud) 我不知道代码是如何const countFrom = x => () => (x++, x);工作的:
const countFrom = x => () => (x++, x);
let a = countFrom(1)
console.log('output:', a()) // output: 2
console.log('output:', a()) // output: 3
console.log('output:', a()) // output: 4
console.log('output:', a()) // output: 5Run Code Online (Sandbox Code Playgroud)
.as-console-wrapper {min-height: 100%!important; top: 0;}Run Code Online (Sandbox Code Playgroud)