Javasript learning "functions recap" lets you pass with incorrect code


Section will accept code that is incorrect. I wrote this incorrect code and it accepts it.

Incorrect code:

var nameString = function(name) {
	return "Hi, I am" + " " + name;

This prints "[Function]" on the console.


The lesson checker does not examine our code, or our test statements. It uses its own test argument, "Suzie". As long as the return value is what is expected, then the lesson will pass. The function is correct.

Because that what nameString is, a function. Just passing the name of the function as an argument does not invoke it.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.