Question: 1. Make all countries in the following array follow the same formatting: // The first letter should be upper case, the rest lower case. Print
1. Make all countries in the following array follow the same formatting: // The first letter should be upper case, the rest lower case. Print the // result to the console.
var countries = ["AustraliA", "greece", "PERU", "ChInA"];
// 2. Get every second and third letter from each country and concatenate them. // Print the results to the console.
// 3. In the sentence below replace 'dart' with 'arrow' by using the indexOf // and slice functions.
var sentence = "Time flies like an dart; fruit flies like a banana.";
// 4. Find the index of the last occurrence of flies in sentence.
// 5. Prompt the user for a string, reverse it, and show the result to the user.
. javascript
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
