Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is my code: //Declaring variables and prompting let word = prompt(Please enter a word? ); var word_array = word.split(); var rev_word = word_array.reverse(); //Reversing

Here is my code:

//Declaring variables and prompting let word = prompt("Please enter a word? "); var word_array = word.split(""); var rev_word = word_array.reverse(); //Reversing array var rev_word = rev_word.join(""); //Converting Array back to string console.log("Reversed Word is: " + rev_word); //Replacing every 2nd character word_array.reverse(); for (var i = 0; i < word_array.length; i++) { if (i % 2 == 1) { word_array[i] = "!"; } } var new_word = word_array.join(""); console.log("New Word: " + new_word);

Lecturers review: You still need to complete 2 requirements for your wordManip task. Every 6th letter must be uppercase. For this you can use a for loop and the toUpperCase() function. An array of the ASCII codes - for this you could look into using the charCodeAt() function.

Please help fix according to lecturers comments

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

Answered: 1 week ago

Answered: 1 week ago