Write a javascript program that takes a string and returns a new string with capitalized words.
Write a javascript program that takes a string and returns a new string with capitalized words.
Student
Skilled in SEO, content writing, and digital marketing. Completed several years of working in many organizations including multinational companies. I love to learn new things in life that keep me motivated.
Certainly! You can achieve this by splitting the input string into words, capitalizing each word, and then joining them back into a new string. Here's a simple JavaScript program for this:
This capitalizeWords function takes an input string, splits it into an array of words, capitalizes each word, and then joins them back into a new string. The example usage demonstrates how to use the function with a sample input string.