What's wrong?JS 11


#1


var my_number = 7; //this has global scope
what is wrong?

var timesTwo = function(number) {
my_number = number * 2;
console.log("Inside the function my_number is: ");
console.log(my_number);
};

console.log("Outside the function my_number is: ");
timesTwo(7);
console.log(my_number);


#2

It never worked? After you posted the last time?

To explain in more detail,

here

should be written like this like I said before,

timesTwo(7);
console.log("Outside the function my_number is: ");
console.log(my_number);

#3

ar nameString = function(name) {
return "Hi,I am " + " " + name;
};
nameString("Zeke")
console.log(nameString)
fix this code piz


#4

Hello @101006,

Your function is JavaScript takes a parameter name. So you must pass nameString("Zeke") into console.log() in order for you to pass this exercise. Hope this fixes your issue...


#5

he means call these two on the same line, so that your code can work


#6

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

still is not working...


#7

You should start a separate topic for this issue. But if you don't, there is a very slight difference between the phrase in your return statement and what the exercise expects. Aside from that, code looks good.


#8

If you have a space here, "Hi,I am " you don;'t need to add this here, " "


#9

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