How do u type a variable in javascript the instructons they have makes no sense


#1

how to type a variable in javascript the instructons they have makes no sense


#2

var variable = value

simple way


#3

yeah but I can only type a letter In the tutorial , only one letter per line


#4

A variable always starts with 'var' and then the name of your variable. You need to make it equal to something. This could be a string, like your name in quotes " " or a number or an array.

For example:
var name = Elise;

var number = 88;

What exercise are you doing that you can only type one letter a line? I don't recall this one. Can you maybe post a link?


#5

This is a generalization that does not actually apply in the global namespace. The var keyword is used inside function bodies to define scope.


#6

I know what problem you are having. type a whole bunch on one line, save and submit the assignment and then reload your page. its not your code that is wrong, but the browser isn't loading right.


#7

sometimes just reloading the browser will work. if you can try using a different browser, that might work.


#8

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