Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!