How and what do i do to declare a variable in a JavaScript?

Hey there.

I’m a Java newbie(i consider so.) and im new to this community.

I do scripting and coding for the game “MapleStory”.

As the Topic Subject says,

How do I declare a variable in a JavaScript?

What do I do to declare a variable in a JavaScript?

What does a variable do in a JavaScript?

=========================================

Sorry for asking 3 questions, but I’m pretty curious and I’m wanting to learn.

declare:


var <varname>;

set:


<varname> = <value>;

hope I helped.

It should be noted that Java is not the same as JavaScript, so this might not be the right community for you (that doesn’t mean you’re not welcome).

To answer your last question…

What does a variable do in a JavaScript?

Variables, like in algebra, are placeholders for values. If my variable ‘x’ is set to 10, then this:


square = x*x;

Will be processed as:


square = 10*10;

There is a nice variables tutorial on w3schools: http://w3schools.com/js/js_variables.asp

he’s developing this for odinms -> www.forum.ragezone.com and that is Java, he is just making scripts for javax.script.

umm, yea im developing odinms in RaGEZONE.

is it, example

if i use

help = 15*15

then when i use the word help in my javascript, it will automatically be processed as a 15*15?

or can you like show me a script of how to use a variable?

like if you use want 15*15 on somewhere, how do you use this variable?

::EDIT::

the w3schools’s are for javascripts IN html files

is it somehow different?

no theyre not different