Discuss / JavaScript / normalize 这样写觉得挺满意的

normalize 这样写觉得挺满意的

Topic source

低位

#1 Created at ... [Delete] [Delete and Lock User]
function normalize(arr) {
    return arr.map(function(item){
        return item.toLowerCase();
    })
    .map(function(item){
        return item[0].toUpperCase() + item.slice(1);
    });
}

  • 1

Reply