Explore what CodeHS has to offer for districts, schools, and teachers.
Click on one of our programs below to get started coding in the sandbox!
View All
What is printed to the console when the following program is run:
function main() { let text = ""; addGreeting(text, "Nice to meet you"); addName(text, "Pascal"); excite(text); console.log(text); } function addGreeting(message, greeting) { return message + greeting; } function addName(message, name) { return message + " " + name; } function excite(message) { return message + "!"; } main();
Nice to meet you Pascal!
Nice to meet you Pascal
Nice to meet you
Nothing. In order to print “Nice to meet you Pascal!” on one line, the return statements on lines 11, 15, and 19 should be replaced with console.log functions.
console.log
Nothing. In order to print “Nice to meet you Pascal!” on one line, lines 4, 5, and 6 should all start with text =.
text =