4/30 no output?


#1

this is my code..it passed..

var james = {
    job: "programmer",
    married: false,
    sayJob: function() {
        // complete this method
        console.log("Hi, I work as a"+" "+this.job);
    }
};

// james' first job
james.sayJob(2);

// change james' job to "super programmer" here
james.job="super programmer";

// james' second job
james.sayJob();

#2

We can pass all the arguments we wish to a function, and never use them (which makes little or no sense, but just the same). Our code is still valid. We only run into problems if our function refers to a parameter that is not present in the arguments object

function foo() {
    return bar;
}
foo();

Results in, ReferenceError: 'bar' is not defined

function bar() {
    return "Didn't see the argument, but don't care, either.";
}
bar("foobar");

#3

2 posts were split to a new topic: How did james.sayJob(2)


#4