Variables (A JS Tutorial)
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."
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
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.
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
=]
Viariables...
Congrats
You made a 1 paragraph subject on WC 5 paragraphs xD
@malcolmmcswain
Plus... for a JS tutorial you dont star with variables... cummon your better then this! -_-
lol no one said you had to learn a lot in one hour for hour of code :P
Wait you don't know javascript? BRUHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
OFC I KNO JAVASCRIPT
THIS TUTORIAL IS FOR HOUR OF CODE LOL
Bruh... You realize i could top this tutorial with 20 minutes to make a tutorial? Letteralone a hour LOL
Hour of Code... Wait You live in vegas? O_o
omg I kid I live in SF and this tutorial is not for hour of code it's just an introductory, comprehensive tutorial
and we cycled back to YOU DONT START A INTRODUCTORY TUTORIAL TO JS WITH VARIABLES! YOU BAFOON! XD
Other then that you did put more detail in it then WC so thumbs up there... x'D
But you also missed aspects :P
Like?
Well, for one, I guess I forgot about objects lol
I'll make a part 2
Not to mention arrays :P
But where should I start with a JS tutorial other than variables?
lol tru
and JSON objects :P
ok ok I get it JSON is not introductory though
Well first you need a reason to need a variable Malcolm... Keep that in mind :P
Well, yeah, lol
WOOOO I JUST SSED UP LOL
Love the idea, props I might suggest a super basic outline that non-coders can follow to set up and start coding
OMG I KNO THAT FEEL WHEN UR JUST TALKIN AND YOU NOTICE IT
There you go woodrow LOL
\(\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? >.<
*facedesk*
well, most ides can run JS inside the program
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
Also, jay, you know what, take it back.
Before you learn JS, you should just start with good old fashioned HTML
:p a basic html skeleton, where to put <script>, and a reference to nice editor like notepad++
EXACTLY BINGO THERES THE TICKET MALCOLM!
Took you long enough to realize it xD
You should learn basic syntax and how it works, then you should learn basic HTML, then CSS, then move onto JavaScript.
\(\color{#0cbb34}{\text{Originally Posted by}}\) @woodrow73 :p a basic html skeleton, where to put <script>, and a reference to nice editor like notepad++ \(\color{#0cbb34}{\text{End of Quote}}\) Exactly... start with html and NOTEPAD++???
The most fundamental thing to learn is what syntax is how it works etc etc.
NOTEPAD++ IS SO BAD THO
http://notepad-plus-plus.org/ Bruh... I use regular notepad malcolm and do everything that i do :P
If you're going to use a free IDE, use Atom 2... it's pretty great
I USE NOTEPAD DEAL WITH IT
REGULAR NOTEPAD
THAT COMES WITH WINDOWS
GET ON MY LEVEL LOL
:O
Any IDE that suits your fancy lols ms notepad coding is nuts #gohard
DUDE RLLY U DONT EVEN HAVE SYNTAX HIGHLIGHTING XD
USE ATOM JAY
//takes note
:)
NO
I WILL USE NOTEPAD
BECAUSE IM BEAST LIKE THAT TO DO AMAZING CODE ON NOTEPAD
DEAL WITH IT K
I have notepad++... literally never use it xD
used it for 5 minutes said no and continued in notepad xD
Just a quick note. Atom and Notepad++ are both text editors. IDEs (Integrated Development Environments) are something different (although you can write code in those to).
^ true A good IDE is Coda 2 for mac And Microsoft Visual Studio for windows
Instead of learning JavaScript why not learn a programming language that compiles to JavaScript. Brython GHCJS TypeScript Are to name a few. What are their benifets? They are not JavaScript.
^... Well then -_-
Join our real-time social learning platform and learn together with your friends!