Skip to content

Added Functions to Change Tutorials Array to Title Case#16

Open
Lsimmons98 wants to merge 1 commit into
learn-co-curriculum:masterfrom
Lsimmons98:workingBranch
Open

Added Functions to Change Tutorials Array to Title Case#16
Lsimmons98 wants to merge 1 commit into
learn-co-curriculum:masterfrom
Lsimmons98:workingBranch

Conversation

@Lsimmons98
Copy link
Copy Markdown

Added a function which splits each string into an array, capitalizes the first letter of each word, then joins them back together into a string. I then used this function as a callback function to map it onto each item of the tutorials array.

Comment thread index.js

const titleCased = () => {
return tutorials
const testFunction = (string) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be a better name for testFunction?

Comment thread index.js

const titleCased = () => tutorials.map((item) => testFunction(item))

console.log(titleCased())
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you clean up your code when you're done!

Suggested change
console.log(titleCased())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants