Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create JavaScript function In HTML Function 9A: Repeating Characters function _nine (str) Create a JavaScript function that meets the following requirements: Please give your function
Create JavaScript function In HTML
Function 9A: Repeating Characters
function _nine(str)
Create a JavaScript function that meets the following requirements:
- Please give your function a descriptive name
- ( _nine is not acceptable, and is only displayed here for illustration purposes)
- That takes in a string
- The function returns the first character that repeats
- If there is no character that repeats, return -1
- The function should be case sensitive (case sensitive "I" not equal to "i")
Examples:
_nine("legolas") "l"
_nine("Gandalf") "a"
_nine("Balrog") "-1"
_nine("Isildur") "-1"
Function 10A: Capitalize first Letter of Each Word
function _ten(string)
Create a JavaScript function that meets the following requirements:
- Please give your function a descriptive name
- ( _ten is not acceptable, and is only displayed here for illustration purposes)
- That takes in a string as an argument
- The function converts first character of each word to uppercase
- The function returns the newly formatted string
Examples:
_ten("This is a title") "This Is A Title"
_ten("capitalize every word") "Capitalize Every Word"
_ten("I Like Pizza") "I Like Pizza"
_ten("PIZZA PIZZA PIZZA") "PIZZA PIZZA PIZZA"
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started