Please need help with this dont know what am getting wronged

javascript

#1

console.log('Morning Alarm is set to: ',morningAlarm);


#2

the word Alarm should be alarm (a not A)


#3

I did tried it but problem still exist!


#4

According to the instructions this is the code.

var morningAlarm = '6:30AM';
morningAlarm = '9:00AM';
console.log('Morning alarm is set to:',morningAlarm);

after running it I got this problem:
console.log('Morning Alarm is set to: ',morningAlarm);

And I changed the cap A to 'a' from where ever I have the word "Alarm" to. What i got was that morningAlam is not defined.


#5

instruction:
On line 3, use

console.log('Morning alarm is set to: ', morningAlarm)

to print out your alarm to the console.

so according to instruction you have to do the same. sorry i cant tell you clearly.i just wanted to say change the string only.you chnged the name of varibale too.

so you got that error meassage( morningAlam is not defined.)

if your code is like

var morningAlarm = '6:30AM';
morningAlarm = '9:00AM';
console.log('Morning alarm is set to:',morningAlarm);

then its fine.only difference from the instruction is a space between: ' inside console.log


#6

This is exactly what I wrote in line 3. isn't it ?
console.log('Morning alarm is set to: ', morningAlarm)

I did played with morningAlam as the new variable to replace the first declared var.

Besides, changing string in the code has nothing to do with the error.

Besides, I have tried removing the space and just now I tried it again, its still same, I think it a bug issue and already reported, yet still waiting hoping they will solve it quickly so I can proceed with the rest of lessons.

Thanks so much.


#7

can you please give me a screen shot?

and one thing you have to do step by step.you cant do all at once.first complete step one then go for the second.


#8

var morningAlarm = '6:30AM';
morningAlarm='8:30PM';
console.log('Morning alarm is:',morningAlarm);

Thanks so much it works just now please re-check this code that worked, any difference with the previous code.


#9

No.but there is difference from the instruction is a space between: ' inside console.log what i said before.may be it worked but sometimes it can create a problem so be careful :slight_smile:
always do the same what instruction says even a single space.happy coding :slight_smile:


#10

Noted: and thanks so much


#11

you can do it step by step it will work dont try to get the code and paste it dirctly


#12

Do it step by step, and the code will work.


#14