return strs.reduce((prev, next) => {
let i = 0;
while (prev[i] && next[i] && prev[i] === next[i]) i++;
return prev.slice(0, i);
});
代码如上,箭头函数我明白,代码相当于function(prev,next){}
请问下这里的prev和next作为参数是什么样的用法呢?
搜索next和prev得到的都是jquery的资料。。
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
认证0级讲师