malcolmmcswain
  • malcolmmcswain
Variables (A JS Tutorial)
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
katieb
  • katieb
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
malcolmmcswain
  • malcolmmcswain
Introduction When you are programming in JS, sometimes you will need to use variables. Variables are just values that can be easily changed. A variable can be anything: a string, a number, an expression, or even another variable! In JS, a variable is declared using the var function: http://prntscr.com/99520d When this code is run, a variable called "variable" will be created with the value "value."
malcolmmcswain
  • malcolmmcswain
Strings A variable can also be a string. A string is just a chain of characters notated with quotations. http://prntscr.com/9954z2 This variable, catNoise, has a value "meow," so that if we were to display this variable, it would look like this: meow A variable can also be a combination of strings. You can add together different strings to create a new one: http://prntscr.com/9cof9r
malcolmmcswain
  • malcolmmcswain
Numbers Another common type of variable is a number variable. Number variables can be computed and plugged into equations http://prntscr.com/9c76lv Notice that there are no quotations around the number. If there were, this would be considered a string, even if the contents of the string are numbers.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

malcolmmcswain
  • malcolmmcswain
Computations Variables can be computations between numbers as well. You can use basic operations like: Addition: + Subtraction: - Multiplication: * Division: / http://prntscr.com/9c78cd You can also compute variables that are numbers. http://prntscr.com/9c78ye
AlexandervonHumboldt2
  • AlexandervonHumboldt2
=]
Jaynator495
  • Jaynator495
Viariables...
Jaynator495
  • Jaynator495
Congrats
Jaynator495
  • Jaynator495
You made a 1 paragraph subject on WC 5 paragraphs xD
Jaynator495
  • Jaynator495
@malcolmmcswain
Jaynator495
  • Jaynator495
Plus... for a JS tutorial you dont star with variables... cummon your better then this! -_-
malcolmmcswain
  • malcolmmcswain
lol no one said you had to learn a lot in one hour for hour of code :P
Jaynator495
  • Jaynator495
Wait you don't know javascript? BRUHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
malcolmmcswain
  • malcolmmcswain
OFC I KNO JAVASCRIPT
malcolmmcswain
  • malcolmmcswain
THIS TUTORIAL IS FOR HOUR OF CODE LOL
Jaynator495
  • Jaynator495
Bruh... You realize i could top this tutorial with 20 minutes to make a tutorial? Letteralone a hour LOL
Jaynator495
  • Jaynator495
Hour of Code... Wait You live in vegas? O_o
malcolmmcswain
  • malcolmmcswain
omg I kid I live in SF and this tutorial is not for hour of code it's just an introductory, comprehensive tutorial
Jaynator495
  • Jaynator495
and we cycled back to YOU DONT START A INTRODUCTORY TUTORIAL TO JS WITH VARIABLES! YOU BAFOON! XD
Jaynator495
  • Jaynator495
Other then that you did put more detail in it then WC so thumbs up there... x'D
Jaynator495
  • Jaynator495
But you also missed aspects :P
malcolmmcswain
  • malcolmmcswain
Like?
malcolmmcswain
  • malcolmmcswain
Well, for one, I guess I forgot about objects lol
malcolmmcswain
  • malcolmmcswain
I'll make a part 2
Jaynator495
  • Jaynator495
Not to mention arrays :P
malcolmmcswain
  • malcolmmcswain
But where should I start with a JS tutorial other than variables?
malcolmmcswain
  • malcolmmcswain
lol tru
Jaynator495
  • Jaynator495
and JSON objects :P
malcolmmcswain
  • malcolmmcswain
ok ok I get it JSON is not introductory though
Jaynator495
  • Jaynator495
Well first you need a reason to need a variable Malcolm... Keep that in mind :P
malcolmmcswain
  • malcolmmcswain
Well, yeah, lol
Jaynator495
  • Jaynator495
WOOOO I JUST SSED UP LOL
woodrow73
  • woodrow73
Love the idea, props I might suggest a super basic outline that non-coders can follow to set up and start coding
malcolmmcswain
  • malcolmmcswain
OMG I KNO THAT FEEL WHEN UR JUST TALKIN AND YOU NOTICE IT
Jaynator495
  • Jaynator495
There you go woodrow LOL
malcolmmcswain
  • malcolmmcswain
\(\color{#0cbb34}{\text{Originally Posted by}}\) @woodrow73 I might suggest a super basic outline that non-coders can follow to set up and start coding \(\color{#0cbb34}{\text{End of Quote}}\) What? Like an IDE? >.<
Jaynator495
  • Jaynator495
*facedesk*
malcolmmcswain
  • malcolmmcswain
well, most ides can run JS inside the program
Jaynator495
  • Jaynator495
FOR CRYING OUT LOUD *stars on Jaynators Complete Ultimate JavaScript Tutorial 1* Although it won't be complete, nor ultimate, your always learning javascript, even when you know all the predefined functions, compatibility, methods etc :P
malcolmmcswain
  • malcolmmcswain
Also, jay, you know what, take it back.
malcolmmcswain
  • malcolmmcswain
Before you learn JS, you should just start with good old fashioned HTML
woodrow73
  • woodrow73
:p a basic html skeleton, where to put