我是新手我已經(jīng)在此鏈接中下載了一些源 https://github.com/the-road-to-learn-react/react-redux-example 我在文件 src/app.js 第 4 行中有一些問題const applyFilter = searchTerm => article => article.title.toLowerCase().includes(searchTerm.toLowerCase());為什么這不能與const applyFilter = searchTerm => article =>{ article.title.toLowerCase().includes(searchTerm.toLowerCase());} 或者const applyFilter = searchTerm => {article => article.title.toLowerCase().includes(searchTerm.toLowerCase());}并在第 14 行調(diào)用函數(shù)時(shí)articles.filter(applyFilter(searchTerm))const applyFilter = searchTerm => article => article.title.toLowerCase().includes(searchTerm.toLowerCase());這在我看來是在箭頭函數(shù)內(nèi)調(diào)用箭頭函數(shù)?他們?cè)趺茨馨?var 'article' 放進(jìn)去?
JavaScript 箭頭函數(shù)中的問題
SMILET
2021-12-23 18:06:42