To Upper Case in 30 Seconds— JavaScript

What do we need to do?

function toUpperCaseFunc(str){}
const arrayOfWords = str.split(" ")
for( let i = 0; i < arrayOfWords.length; i++){
let array = arrayOfWords[i]
word.push(array.charAt(0).toUpperCase() + array[i].slice(1))
}
let word = [];
for( let i = 0; i < arrayOfWords.length; i++){
let array = arrayOfWords[i]
word.push(array.charAt(0).toUpperCase() + array[i].slice(1))
}
function(str){
let arrayOfWords = str.split(" ")
let word = [];
for( let i = 0; i < arrayOfWords.length; i++){
let array = arrayOfWords[i]
word.push(array.charAt(0).toUpperCase() + array[i].slice(1))
}
return word.join(" ")
}

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Javascript Hacks 2.0

Serverless Function in Next JS

Let’s learn fundamentals of Koa JS

Optimize Cube.js Performance with Pre-Aggregations

FabricJS performance hack

🏁 React Final Form HTML5 Validation

React Hooks

Getting Started with Vuetify 2.0

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Anthony Johnson

Anthony Johnson

More from Medium

SE3050 -Application Frameworks Blog — 05

Chapter One: Value, types, and operators.

Validating user inputs on your Express.js application with express-validator

Introduction Node.js