javascript - how to use var properly -


i started learning javascript on codecademy , don't know problem code.

var feedback = prompt("rate game out of 10"); if(feedback > 8) {     console.log("this beginning of game empire. stay tuned more!"); } else {     console.log("i slaved away @ game , gave me score?! nerve! wait!") }; 

it says there's wrong variable. might easy question, don't know how figure out.

the issue klaasman pointed out, had newline break.

console.log("this long string went more 1 line long"); 

if want strings go more 1 line have use \ tell javascript "the string continued on next line"

console.log("this long string \ went more 1 line long"); 

this way write same string this:

console.log("this \ \ \ \ long \  string"); 

you forgot semicolon on last console.log statement.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -