logo CodeStepByStep logo

fixErrors3

Language/Type: JavaScript basics errors functions
Author: Melissa Hovik (on 2016/09/25)

The following program attempts to print a full name given a first name and last name as parameters. The last name should be printed in full, starting with a capital letter and followed by all lowercase letters. A comma and the capitalized first name initial should then follow. For example, the call printName("Abby", "Stepp") should output "Stepp, A." to the console. The initial code contains several kinds of errors. Fix the code below so that it compiles and runs properly.

Function: Write a JavaScript function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.