Menu
Examine the following function definition:
[code]
function printChars(ch, count) {
var string = “”;
while (count > 0) {
string += ch;
count–;
}
document.write(string + “<BR>”);
}
a. Write down exactly the output from the call ‘printChars(“*”, 30)’ as it would appear in a browser.
b. Write a JavaScript loop that uses the defined function to display 10 lines of output in which each line has one more character than its predecessor.