Title Case Converter

This is a personal project I built out of necessity. At my old workplace, I would often find myself using titles on many different areas of a new site build. After a while, I wanted an easier way to convert a phrase to title case. I started using a free online title case converter to take the guesswork out of writing out titles properly. Most of the ones found online though were bloated with ads or popups. I saw an opportunity to recreate a very simple version of this handy tool and I started to code it out in my free time. I started from scratch. I created the elements I was going to work with and got started on the JavaScript logic. I defined the elements I wanted to work with. Then I added event listeners to certain elements that would run a function when clicked. I then created the main function that contains all the logic. This main function captures the user’s input, converts each word to lowercase, then returns each word from the user input into a new array. I then created an “exceptions” array that contains all the words that are not supposed to be capitalized in a title. After, I run a for loop that runs some checks and balances and then decides if one of the array items needs to be capitalized or not by comparing it to the “exceptions” array. Once it finishes with that, it spits out the newly modified array and joins it into a string and displays it on the page. The other function was a simple way for the user to copy the result to their clipboard. Overall this project was perfect for my skill level and was an awesome learning experience. I got to think like a computer and used my research skills to come up with a working project to use and call my own.

Technology Used:

HTML, CSS, JavaScript, Git