Forums

Give help. Get help.

  • # June 24, 2013 at 8:24 pm

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

    I’m kinda stuck on this can someone help me?
    i’m thinking its this : but its not working. i know i’m wrong just dont know where

    var greeting;
    var name =”Attila”

    # June 24, 2013 at 9:03 pm

    You would call it like `greeting(‘Attila’);`

    # June 24, 2013 at 9:33 pm

    It would look like this:

    var greeting = function (name) {
    alert(‘Hello, ‘+name);
    }

    greeting(‘Jiggins’);

    # June 25, 2013 at 12:03 am

    What are you really asking here? In the example you provide above, you don’t need to create a new var for `val` because you can just console log `name` directly.

    # June 25, 2013 at 12:08 am

    Right, because all you’ve done is create a function. You then have to actually *call* the function, like this:

    greeting(‘Jiggins’);

    So the final correct answer would be:

    var greeting = function (name) {
    console.log(name);
    };

    greeting(‘Jiggins’);

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag