标签:
The join() method joins all elements of an array into a string.
var name = ‘shane osbourne‘; var upper = name.split(‘ ‘) // [shane, osbourne] .map(x => x.charAt(0).toUpperCase() + x.slice(1)) // [Shane, Osbourne] .join(‘ ‘); console.log(upper);
标签:
原文地址:http://www.cnblogs.com/Answer1215/p/4862771.html