How to Capitalize Strings in JavaScript
Posted on: February 14, 2021 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.
Share on social media
//