Question: JAVA SCRIPT PLEASE You are given a recursive function, `printLettersBetween()`, that takes a start and end letter and prints all the letters between them in
| JAVA SCRIPT PLEASE | |
| You are given a recursive function, `printLettersBetween()`, that takes | |
| a start and end letter and prints all the letters between them in order. | |
| If the start letter comes before the end letter in the alphabet, the letters | |
| should print out in alphabetical order. Otherwise, it should print in reverse | |
| alphabetical order. You are given an array of letters in the aplphabet to work | |
| with for this problem. | |
| The code is almost working but unfortunately, there are a few bugs. Use | |
| the debugging skills you've been practicing and the VSCode debugger to | |
| identify and solve the bugs. | |
| Examples: | |
| const alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; | |
| printLettersBetween(alphabet, "a", "c"); | |
| // a | |
| // b | |
| // c | |
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
