Is anyone else having problems with variable exercise 4?


#1

Exercise 4/6 Changing a Variables Value

For some reason, whenever I try to change the variable morningAlarm from 6:30AM to 7:30AM, Codecademy keeps complaining “expected ‘6:30AM’ to not include '6”. Is this just a problem with codecademy, or is there some error in my code? Any help is appreciated.



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



#2

you should use + to concatenate the string not a comma (,)

the comma causes a new line/additional space, anyway, it causes unwanted problems


#4

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