This content originally appeared on CodeSource.io and was authored by Ariessa Norramli
In this article, you will learn How to Capitalize Strings in JavaScript.
Let’s say you have a string variable named ‘a’ with the value “codesource”.
var a = "codesource";
In order to capitalise the value of a, you can use the toUpperCase()
method.
var a = "codesource";
var b = a.toUpperCase();
Note: The toUpperCase()
method functions by converting all alphabetical characters in a string to uppercase letters.
The post How to Capitalize Strings in JavaScript appeared first on CodeSource.io.
This content originally appeared on CodeSource.io and was authored by Ariessa Norramli

Ariessa Norramli | Sciencx (2021-02-14T16:41:26+00:00) How to Capitalize Strings in JavaScript. Retrieved from https://www.scien.cx/2021/02/14/how-to-capitalize-strings-in-javascript/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.