“Touppercase” Ответ

javaScript wangize String

//capitalize only the first letter of the string. 
function capitalizeFirstLetter(string) {
    return string.charAt(0).toUpperCase() + string.slice(1);
}
//capitalize all words of a string. 
function capitalizeWords(string) {
    return string.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); });
};
Grepper

Touppercase

const names = ['Ali', 'Atta', 'Alex', 'John'];

const uppercased = names.map(name => name.toUpperCase());

console.log(uppercased);

// ['ALI', 'ATTA', 'ALEX', 'JOHN']
Gifted Goose

Ответы похожие на “Touppercase”

Вопросы похожие на “Touppercase”

Смотреть популярные ответы по языку

Смотреть другие языки программирования