{"id":93983,"date":"2019-07-11T07:00:39","date_gmt":"2019-07-11T04:00:39","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=93983"},"modified":"2019-07-11T13:21:24","modified_gmt":"2019-07-11T10:21:24","slug":"javascript-capitalize-first-letter-string","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html","title":{"rendered":"JavaScript Capitalize the First Letter of a String Example"},"content":{"rendered":"<p>In this example we will check the JavaScript Capitalize the First Letter of a String implementation. JavaScript provides many functions to work with Strings in general. We will leverage a few of them to achieve our aim. There are more than one way of accomplishing the task at hand and we shall take a look at a couple of them.<\/p>\n<h2 class=\"wp-block-heading\">1. Initial Setup<\/h2>\n<p>So, let us dive in and get started. For the purposes of this article I will build a small NodeJS application which will serve our static web page with the example. You do not need knowledge of NodeJS to follow along though. The structure of our project looks like below:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"368\" height=\"342\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/07\/ProjectStructureJSCapitalizeExample.jpg\" alt=\"JavaScript Capitalize the First Letter - Project Structure\" class=\"wp-image-94018\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/07\/ProjectStructureJSCapitalizeExample.jpg 368w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/07\/ProjectStructureJSCapitalizeExample-300x279.jpg 300w\" sizes=\"(max-width: 368px) 100vw, 368px\" \/><figcaption>Project Structure<\/figcaption><\/figure>\n<\/div>\n<p>Our UI would simply let the user type in a string and we will capitalize the first letter of the string and display the result. To go about the same the HTML of our UI would like below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>index.html<\/em><\/span><\/p>\n<pre class=\"brush: html;\"> &lt;!DOCTYPE html&gt;\n&lt;html&gt;\n    &lt;head&gt;\n    &lt;\/head&gt;\n    &lt;body&gt;\n        &lt;fieldset&gt;\n            &lt;legend&gt;\n                &lt;h3&gt;JCG -- JavaScript Capitalize First Letter of String Example&lt;\/h3&gt;\n            &lt;\/legend&gt;\n            &lt;label for=\"userinput\"&gt;Please enter text&lt;\/label&gt;\n            &lt;input type=\"text\" id=\"userinput\"&gt;\n            &lt;button type=\"button\" id=\"capitalize\"&gt;Capitalize&lt;\/button&gt;\n            &lt;label for=\"result\"&gt;Result&lt;\/label&gt;\n            &lt;span style=\"font-weight: bold\" id=\"result\"&gt;&lt;\/span&gt;\n        &lt;\/fieldset&gt;\n        &lt;script src=\".\/myscript.js\"&gt;&lt;\/script&gt;\n    &lt;\/body&gt;\n&lt;\/html&gt; <\/pre>\n<p>The above UI looks like below:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"749\" height=\"338\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/07\/JSCapitalizeIndexPage.jpg\" alt=\"JavaScript Capitalize the First Letter\" class=\"wp-image-94032\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/07\/JSCapitalizeIndexPage.jpg 749w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/07\/JSCapitalizeIndexPage-300x135.jpg 300w\" sizes=\"(max-width: 749px) 100vw, 749px\" \/><\/figure>\n<\/div>\n<p>Next, we write code in our JavaScript file myscript.js. We implement two functions, named, capitalizeUsingStringFunctions and capitalizeUsingSliceFunction. We discuss there implementation next<\/p>\n<h2 class=\"wp-block-heading\">2. Capitalizing Using String Functions<\/h2>\n<p>JavaScript provides several methods to work with strings. Of particular interest to us here are the charAt, toUpperCase and substring functions. Since string is treated as an array of character we can use chartAt function to get the character at a particular position within the string. <\/p>\n<p>We will use it to get the first character and then call the toUpperCase function on the return value. This will capitalize the first character next we will append the remaining string extracted using the substring function and return the result to the calling code. Our function looks like below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>myscript.js<\/em><\/span><\/p>\n<pre class=\"brush: js;\">function capitalizeUsingStringFunctions(str) {\n    return str.charAt(0).toUpperCase() + str.substring(1, str.length);\n} \n<\/pre>\n<h2 class=\"wp-block-heading\">3. Capitalizing Using Slice Function<\/h2>\n<p>Like mentioned before strings in JavaScript are treated as arrays of characters. Thus we can leverage array manipulation functions on strings as well. One in particular, slice, will prove useful to implement our objective here.<\/p>\n<p>We will use the slice method to extract the first character from the string and capitalize it. We will then append this to the remaining string extracted again using slice function and return the result to the calling code. Our function would look like below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>myscript.js<\/em><\/span><\/p>\n<pre class=\"brush: js;\">function capitalizeUsingSlice(str) {\n    return str.slice(0, 1).toUpperCase() + str.slice(1, str.length);\n} \n<\/pre>\n<p>After implementing the above two methods we will complete the code to call them and display the result. Our completed code would look like below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>myscript.js<\/em><\/span><\/p>\n<pre class=\"brush: js;\">let input = document.getElementById(\"userinput\");\nlet result = document.getElementById(\"result\");\nlet button = document.getElementById(\"capitalize\");\n\nbutton.addEventListener(\"click\", function(evt) {\n    \/\/result.innerHTML = capitalizeUsingSlice(input.value);\n    result.innerHTML = capitalizeUsingStringFunctions(input.value);\n});\n\n\nfunction capitalizeUsingSlice(str) {\n    return str.slice(0, 1).toUpperCase() + str.slice(1, str.length);\n}\n\nfunction capitalizeUsingStringFunctions(str) {\n    return str.charAt(0).toUpperCase() + str.substring(1, str.length);\n} <\/pre>\n<h2 class=\"wp-block-heading\">4. Running the Code<\/h2>\n<p>When we run the code and hit the url in the browser, we can see our code in action as below:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"754\" height=\"336\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/07\/ScreenGrabJSCapitalizeExample.jpg\" alt=\"JavaScript Capitalize the First Letter\" class=\"wp-image-94038\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/07\/ScreenGrabJSCapitalizeExample.jpg 754w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/07\/ScreenGrabJSCapitalizeExample-300x134.jpg 300w\" sizes=\"(max-width: 754px) 100vw, 754px\" \/><\/figure>\n<\/div>\n<p>As you can see I have entered my name in all lower case. Next I click the Capitalize button to display the Result with initial letter capitalized.<\/p>\n<h2 class=\"wp-block-heading\">5. Download the Source Code<\/h2>\n<p>This was an example on how to capitalize the first letter of a string. To run the project you need to run the below commands at the root of the project<\/p>\n<pre class=\"brush: bash;\">&gt; npm install\n&gt; npm start<\/pre>\n<p>After this, point the browser to the following URL:<\/p>\n<p><code>http:\/\/localhost:8080<\/code><\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/07\/JCG-JavaScript-InitCaps-Example.zip\"><strong>JavaScript Capitalize the First Letter of a String Example<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this example we will check the JavaScript Capitalize the First Letter of a String implementation. JavaScript provides many functions to work with Strings in general. We will leverage a few of them to achieve our aim. There are more than one way of accomplishing the task at hand and we shall take a look &hellip;<\/p>\n","protected":false},"author":82952,"featured_media":20900,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1879],"tags":[],"class_list":["post-93983","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JavaScript Capitalize the First Letter of a String - Java Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Interested to learn more about JavaScript? Then check out our detailed example on JavaScript Capitalize the First Letter of a String implementation!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Capitalize the First Letter of a String - Java Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Interested to learn more about JavaScript? Then check out our detailed example on JavaScript Capitalize the First Letter of a String implementation!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-11T04:00:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-11T10:21:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Siddharth Seth\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Siddharth Seth\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/07\\\/javascript-capitalize-first-letter-string.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/07\\\/javascript-capitalize-first-letter-string.html\"},\"author\":{\"name\":\"Siddharth Seth\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/09c54717e2cc7956aa8a2df61330f18c\"},\"headline\":\"JavaScript Capitalize the First Letter of a String Example\",\"datePublished\":\"2019-07-11T04:00:39+00:00\",\"dateModified\":\"2019-07-11T10:21:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/07\\\/javascript-capitalize-first-letter-string.html\"},\"wordCount\":523,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/07\\\/javascript-capitalize-first-letter-string.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/javascript-logo.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/07\\\/javascript-capitalize-first-letter-string.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/07\\\/javascript-capitalize-first-letter-string.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/07\\\/javascript-capitalize-first-letter-string.html\",\"name\":\"JavaScript Capitalize the First Letter of a String - Java Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/07\\\/javascript-capitalize-first-letter-string.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/07\\\/javascript-capitalize-first-letter-string.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/javascript-logo.jpg\",\"datePublished\":\"2019-07-11T04:00:39+00:00\",\"dateModified\":\"2019-07-11T10:21:24+00:00\",\"description\":\"Interested to learn more about JavaScript? Then check out our detailed example on JavaScript Capitalize the First Letter of a String implementation!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/07\\\/javascript-capitalize-first-letter-string.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/07\\\/javascript-capitalize-first-letter-string.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/07\\\/javascript-capitalize-first-letter-string.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/javascript-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/javascript-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/07\\\/javascript-capitalize-first-letter-string.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Development\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\\\/javascript\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"JavaScript Capitalize the First Letter of a String Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/09c54717e2cc7956aa8a2df61330f18c\",\"name\":\"Siddharth Seth\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"caption\":\"Siddharth Seth\"},\"description\":\"Siddharth is a Software Development Professional with a Master degree in Computer Applications from IGNOU. He has over 14 years of experience. And currently focused on Software Architecture, Cloud Computing, JavaScript Frameworks for Client and Server, Business Intelligence.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/siddharth-seth-240180\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/siddharth_seth1980\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JavaScript Capitalize the First Letter of a String - Java Code Geeks - 2026","description":"Interested to learn more about JavaScript? Then check out our detailed example on JavaScript Capitalize the First Letter of a String implementation!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html","og_locale":"en_US","og_type":"article","og_title":"JavaScript Capitalize the First Letter of a String - Java Code Geeks - 2026","og_description":"Interested to learn more about JavaScript? Then check out our detailed example on JavaScript Capitalize the First Letter of a String implementation!","og_url":"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2019-07-11T04:00:39+00:00","article_modified_time":"2019-07-11T10:21:24+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","type":"image\/jpeg"}],"author":"Siddharth Seth","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Siddharth Seth","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html"},"author":{"name":"Siddharth Seth","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/09c54717e2cc7956aa8a2df61330f18c"},"headline":"JavaScript Capitalize the First Letter of a String Example","datePublished":"2019-07-11T04:00:39+00:00","dateModified":"2019-07-11T10:21:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html"},"wordCount":523,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html","url":"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html","name":"JavaScript Capitalize the First Letter of a String - Java Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","datePublished":"2019-07-11T04:00:39+00:00","dateModified":"2019-07-11T10:21:24+00:00","description":"Interested to learn more about JavaScript? Then check out our detailed example on JavaScript Capitalize the First Letter of a String implementation!","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2019\/07\/javascript-capitalize-first-letter-string.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Development","item":"https:\/\/www.javacodegeeks.com\/category\/web-development"},{"@type":"ListItem","position":3,"name":"JavaScript","item":"https:\/\/www.javacodegeeks.com\/category\/web-development\/javascript"},{"@type":"ListItem","position":4,"name":"JavaScript Capitalize the First Letter of a String Example"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/09c54717e2cc7956aa8a2df61330f18c","name":"Siddharth Seth","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","caption":"Siddharth Seth"},"description":"Siddharth is a Software Development Professional with a Master degree in Computer Applications from IGNOU. He has over 14 years of experience. And currently focused on Software Architecture, Cloud Computing, JavaScript Frameworks for Client and Server, Business Intelligence.","sameAs":["https:\/\/www.linkedin.com\/in\/siddharth-seth-240180\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/siddharth_seth1980"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/93983","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/82952"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=93983"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/93983\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/20900"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=93983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=93983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=93983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}