String.prototype.first2Upper=字符串.prototype.first2上层||function(){ return this.charAt(0).toUpperCase()+this.slice(1); } //使用 'somestring'.first2Upper();//=> Somestring公司
var numArray=[“一”,“二”,“三”,“四”] .map(函数(elem){return elem.first2Upper();}); //numArray now:[“一”,“二”,“三”,“四”]