Given a string str and number n , write a program in Javascript that recursively appends a copy of string str n times and returns the resulting string in a sentence explaining whether the resulting...


Given a stringstrand numbern, write a program in Javascript  that recursively appends a copy of stringstrn times and returns the resulting string in a sentence explaining whether the resulting string has an odd or even amount of the passed instr.



"" explaining whether the resulting string has an odd or even amount of the passed instr. """



//-> "aaaaaaaaaaa has a(n) odd number of a's"     EXAMPLE




function RecursiveCopy(str, n) {
if (n === 0) {
return "";
} else {
return RecursiveCopy(str, n - 1) + str;
}
}




where should i add the if statemnt for the odd or even numbers of str ? that code is not complet



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here