📅  最后修改于: 2022-03-11 15:01:40.958000             🧑  作者: Mango
const uppercaseWords = str => str.replace(/^(.)|\s+(.)/g, c => c.toUpperCase());
// Example
uppercaseWords('hello world'); // 'Hello World'