Discuss / JavaScript / 好久没写js了,试一试

好久没写js了,试一试

Topic source

贵阳码农

#1 Created at ... [Delete] [Delete and Lock User]

function string2int(s) { return s.split("").map((elem) => { return elem - 0; }).reduce((acc, next) => { return acc * 10 + next; }); }

function normalize(arr) { return arr.map((ele, index, arr) => { return ele.split("").map(function(e, i, a) { return i == 0 ? e.toUpperCase() : e.toLowerCase(); }).reduce((acc, next) => { return acc += next; }); }); }

r = arr.map((e, i, a) => { return e - 0; });


  • 1

Reply