showing results for - "capitlize strung js"
Nick
27 Aug 2020
1With performance metrics...
2
3// 10,889,187 operations/sec
4function capitalizeFirstLetter(string) {
5    return string[0].toUpperCase() + string.slice(1);
6}
7
8// 10,875,535 operations/sec
9function capitalizeFirstLetter(string) {
10    return string.charAt(0).toUpperCase() + string.slice(1);
11}
12
13// 4,632,536 operations/sec
14function capitalizeFirstLetter(string) {
15    return string.replace(/^./, string[0].toUpperCase());
16}
17
18// 1,977,828 operations/sec
19String.prototype.capitalizeFirstLetter = function() {
20    return this.charAt(0).toUpperCase() + this.slice(1);
21}
22
queries leading to this page
capitalzie a string javascriptcapitalize method injscapitalize variable in javascriptcapitalize text javascriptcapitalize all words in string javascripthow to capitalize a string in jscapitalize a string jscapitalized javascriptcapitalize jscapitalization functions jsjavascript upercasehow to convert small letters to capital letters in jsconvert string to capitalize javascriptcapitalize string javascriptupper case a string javascriptcapitalize word 28string 5bi 5d javascriptjs uppercase stringuncapitalize string javascriptcapitalize words javascripthow to make string upper case in jsjs capitalizejavascript variable capitalizationcapitalize function javascriptlocal capital string javascriptjs auto capitalizenodejs capitalizejavasctipt capital letterscapitalize method javascriptjs capitalize wordcapital letter variables jscapitalize all letters string javascriptcapitalize javascriptcapitaliz jsjavascript capitalizehow to get string without capitalize javascriptuppercase string jsuncapitalize string jscapitilize in jscapitalise string jsjavascript capital letter functioncapitalize string jshow to make string is not capital in javascriptjs capitalize stringcapital case jsjs capitalizejavascript capitalize stringcapitalize in javascriptjs capitalize words in stringhow to capitalize a variable in javascripttouppercase 28 29 is capitalize the whole stringstring to capitalize javascriptcapitalize string js methodcapitalize in jscapitlize strung jshow i capitalize the string with for loop in jsjs string capitalizehow to make a capitalize letter in javascriptcapitalized string javascriptjavascript convert to capital casefunction name will capitalize in jscapitalized function in javascriptjavascript text capital caseextract the words javascript capitalizewhat capitalisation does js usehow to capitalize a sentence in javascriptcapitalize character javascripthow to capitalize a text in javascript capitalize javascriptmake string uppercase javascriptjavascript capatailizecapitalise 28 29 js mndhow to capitalize words in javascriptcapitalize word jscapitalize word javascriptcapitlize jscapitalize sentence jscapatlize the jsjs capitalzejs split string to capital lettertouppercase javascript static stringstring capitalize javascriptconvert small letter to capital in javascriptupcase jscapitalize text using javascriptjavascript capitalization of nameuppercase to capitalize javascriptjavascript string to capital casehow to capitalize in javascriptstring touppercase jscapitalise 28 29 jsmake string capital javascriptstring capitalize javascriptset capitalize in jsjs capitaliseconvert all string to capital jsget capital letters javascriptcapitlize strung js