/    Sign up×
Community /Pin to ProfileBookmark

Back to the beginning

hmm…

A triumphant day occured yesterday. I was able to put all the tiny little scripts (working individualy) into the mother of all scripts I’ve ever made, and when I tried it out, it didn’t work.

That makes me very very sad. ???

Anyway, my main problem seems to be variables in general.

So, I’m going to put down what I know about variables and would like people to just tell what they know about variables if I already don’t have it down.

Here goes:

• Variables set outside of a function are automatically global (Not 100% on that one).

• Variables set within a function have the following attributes.
– If using (var) in front of the variable then it is local
and only accessable via THAT function.
– If not using a (var) in front of the variable then it
becomes global and is able to be used by other
functions.

• Setting a variable is done by using the var “Varable name”.
• Variable Names can only contain Letters, Numbers, and
Underscores
• The variables Dog, DOG, dog, DoG, dOg, DOg, dOG are all
different variables.
• You call variables by placing their name within a JavaScript.
• You can only send variables between pages using forms or
cookies.
• Global Variables are set for the Entire Script.
• Local Variables are used for only that script.

That is basically the basics of variables, now I want some more info about variables.

How are they transferred.
Are they usable both between functions and non-functions
How do they replace one another.
Just ANYTHING!!

Any and All Help is appreciated.
Thanks.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@JonaApr 20.2003 — Variables can start with letters, underscores, but not numbers. Example:

Correct: var xpr;

Correct: var _xpr;

[color=red]Incorrect:[/color] var 12xprs;

? But you probably already knew that... ?
Copy linkTweet thisAlerts:
@BurrowauthorApr 20.2003 — Yeah, but it can still help me review the rules of variables. ?
Copy linkTweet thisAlerts:
@BurrowauthorApr 20.2003 — ? ,

I was sort of hit and miss on some of those.

Oh well, it's better for me to learn all I can about them, they seem to be very tricky, or it could be I haven't had to learn them for around a year or so... either way.

Thanks for variable info.
×

Success!

Help @Burrow spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...