字符串函数扩展

String.prototype.toJadenCase = function () {
    return this.split(' ').map(function(value, index) {
    let arr = value.split('');
        let val = value[0].toUpperCase() + value.slice(1);
    return val;
}).join(' ');
};



 

 

 

 

 

 

本文转载自:http://www.cnblogs.com/Uncle-Keith/p/6230918.html

posted @ 2016-12-28 22:07  代码恶童  阅读(115)  评论(0编辑  收藏  举报