Create a Variable


#1


https://www.codecademy.com/en/courses/learn-javascript/lessons/variables/exercises/create-a-variable?action=lesson_resume

I can't figure out how to set a variable equal to a string. I feel like an idiot since I went back a read over the intro to JavaScript again but didn't see it in there.

var myName ='strength';
console.log(myName , "50,000 pounds");


#2

Your declaration is correct, but the lesson checker may not be expecting what you logged out. Try removing that line, or only print the variable and nothing else.


#3

Okay. But the objective of the lesson is to set the variable to the 50,000 pounds. I'm just having a hard time understanding how to set it to that.


#4

Use the name strength without quotes on the left side of the equals sign, and the other string on the right side.

... = '50,000 pounds'

#5

Ooooh! Thank you so much!!!


#7

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