function normalize(arr) { return arr.map(function (x){ return x.toLowerCase().split('').reduce(function(x, y){ if (x.length === 1){ return x.toUpperCase()+y; } else { return x+y; } }); }); }
Sign in to make a reply
梓鍵_Emerson
function normalize(arr) { return arr.map(function (x){ return x.toLowerCase().split('').reduce(function(x, y){ if (x.length === 1){ return x.toUpperCase()+y; } else { return x+y; } }); }); }