-1
const str = "somethning"
const isParenComplete = (str) => (!str.split(“”).reduce((prev, char) => {
}, 0));
为什么我有一个意外的令牌使用reduce?cloduln't spot我的缩小功能有什么问题
const str = "somethning"
const isParenComplete = (str) => (!str.split(“”).reduce((prev, char) => {
}, 0));
为什么我有一个意外的令牌使用reduce?cloduln't spot我的缩小功能有什么问题
更换" "
为' '
固定对我来说
你在找什么在这里做什么? –
该函数的主体什么也不做,并且什么都不返回,所以最终的结果总是会**为'!undefined' - 也就是'true' ..也可以使用'“”或'''' - 而不是'“” ' - 最后,你永远不会执行'isParenComplete' –