Problems with chapter 3 Function Syntax


#1



https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/0/3?curriculum_id=506324b3a7dffd00020bf661


I cannot go past this page I get the error message:
Oops, try again. You did not call the greeting function. Pass it a name!


var greet = function(hello) {
    return hello;
};
console.log(greet("hello"));

// On line 11, call the greeting function!
nameString = function(name) {
return "Hi, I am" + " " + name
};
nameString("elver");
console.log(nameString("elver"));


#2

First of all, I cannot see your greeting function you created.

But you call it like this:

greeting("Bayo!");


#3

This is the entire code I have:
var greet = function(hello) {
return hello;
};
console.log(greet("hello"));

nameString = function(name) {
return "Hi, I am" + " " + name
};
nameString("elver");
console.log(nameString("elver"));


#4

Your function name there is greet not greeting. You can only call a function you've created.


#5

As i viewed that specific lesson, i'd noticed that the instructions asking you to call your greeting function and put in a name that you want the greeting function to include.

Try to click the reset button then you will see it already declared the function greeting having block of reusable code between { }.

All you need to do is call the function greeting and put in a name that you want the greeting function to include on line 11. For example:

    greeting("Alpha");

#6

Duh! Thanks much! Green-lighted!


#7

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