Javascript not working for me!


won't work !!!!!!!!!!!!!!11


If you expect answers or help you at least need to ask a question... JavaScript unlike HTML+CSS is a programming (scripting language) so it might take some more time to get used to its grammar aso.


hi there
i have just started here and im stuck at the prompt code, would u help me please

i typed
prompt("where are you from?");

and i get an error and out put is null


The code is fine so I would refresh the page and try again


Also if you get null perhaps try to answer your prompt and press ok instead of cancel.


thank you so much for ur help earlier

yes it worked after i wrote the answer ;D



hi there,
can u help me please

is this a valid code?

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

console.log = nameString("sherif");

it keeps saying:
Oops, try again. It looks like you didn't print anything to the console! Did you remember to console.log() the result of passing your name to the nameString() function?


Sry seemed like I'd missed this one. The problem here is that you overwrite console.log with this line:

console.log = nameString("sherif");

To fix it, it needs to be replaced by an acutal function call of console.log:


and maybe a refresh is necessary to reset console.log to it's old value.


thanks a million

can u look at this please

var square = new Object();
square.sideLength = 6;
square.calcPerimeter = function(sideLenth) {
     return this.sideLength * 4;
square.calcArea = function(sideLenth) {
      return this.sideLenth * this.sideLenth;


error:Oops, try again. Your method failed when sideLength was 0 where it returned NaN instead of 0


It will be easier for others to answer your questions if you create your own post for each issue rather than using @locario 's post. So you should make a new post in the relevant category and then people will be able to help you :smile:


u r right
will do

thank u