reduce:
第一题:
return arr.reduce((x,y)=>{
return x*y
});
第二题:
return Array.from(s, item => (item * 1)).reduce((a, b) => { return a * 10 + b })
第三题:
return arr.map(item => {
return item.slice(0, 1).toUpperCase() +item.slice(1).toLowerCase()
})
第四题
r = arr.map(i => parseInt(i));
Sign in to make a reply
11
reduce:
第一题:
return arr.reduce((x,y)=>{
return x*y
});
第二题:
return Array.from(s, item => (item * 1)).reduce((a, b) => { return a * 10 + b })
第三题:
return arr.map(item => {
return item.slice(0, 1).toUpperCase() +item.slice(1).toLowerCase()
})
第四题
r = arr.map(i => parseInt(i));