Ask your own question, for FREE!
Computer Science 19 Online
OpenStudy (malcolmmcswain):

Variables (A JS Tutorial)

OpenStudy (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."

OpenStudy (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

OpenStudy (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.

OpenStudy (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

OpenStudy (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! -_-

OpenStudy (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

OpenStudy (malcolmmcswain):

OFC I KNO JAVASCRIPT

OpenStudy (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

OpenStudy (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

OpenStudy (malcolmmcswain):

Like?

OpenStudy (malcolmmcswain):

Well, for one, I guess I forgot about objects lol

OpenStudy (malcolmmcswain):

I'll make a part 2

jaynator495 (jaynator495):

Not to mention arrays :P

OpenStudy (malcolmmcswain):

But where should I start with a JS tutorial other than variables?

OpenStudy (malcolmmcswain):

lol tru

jaynator495 (jaynator495):

and JSON objects :P

OpenStudy (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

OpenStudy (malcolmmcswain):

Well, yeah, lol

jaynator495 (jaynator495):

WOOOO I JUST SSED UP LOL

OpenStudy (woodrow73):

Love the idea, props I might suggest a super basic outline that non-coders can follow to set up and start coding

OpenStudy (malcolmmcswain):

OMG I KNO THAT FEEL WHEN UR JUST TALKIN AND YOU NOTICE IT

jaynator495 (jaynator495):

There you go woodrow LOL

OpenStudy (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*

OpenStudy (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

OpenStudy (malcolmmcswain):

Also, jay, you know what, take it back.

OpenStudy (malcolmmcswain):

Before you learn JS, you should just start with good old fashioned HTML

OpenStudy (woodrow73):

:p a basic html skeleton, where to put <script>, and a reference to nice editor like notepad++

jaynator495 (jaynator495):

EXACTLY BINGO THERES THE TICKET MALCOLM!

jaynator495 (jaynator495):

Took you long enough to realize it xD

jaynator495 (jaynator495):

You should learn basic syntax and how it works, then you should learn basic HTML, then CSS, then move onto JavaScript.

OpenStudy (malcolmmcswain):

\(\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++???

jaynator495 (jaynator495):

The most fundamental thing to learn is what syntax is how it works etc etc.

OpenStudy (malcolmmcswain):

NOTEPAD++ IS SO BAD THO

jaynator495 (jaynator495):

http://notepad-plus-plus.org/ Bruh... I use regular notepad malcolm and do everything that i do :P

OpenStudy (malcolmmcswain):

If you're going to use a free IDE, use Atom 2... it's pretty great

jaynator495 (jaynator495):

I USE NOTEPAD DEAL WITH IT

jaynator495 (jaynator495):

REGULAR NOTEPAD

jaynator495 (jaynator495):

THAT COMES WITH WINDOWS

jaynator495 (jaynator495):

GET ON MY LEVEL LOL

OpenStudy (malcolmmcswain):

:O

OpenStudy (woodrow73):

Any IDE that suits your fancy lols ms notepad coding is nuts #gohard

OpenStudy (malcolmmcswain):

DUDE RLLY U DONT EVEN HAVE SYNTAX HIGHLIGHTING XD

OpenStudy (malcolmmcswain):

THE BEST IDE EVER: https://atom.io/ AND IT'S FREE

OpenStudy (malcolmmcswain):

USE ATOM JAY

OpenStudy (woodrow73):

//takes note

OpenStudy (malcolmmcswain):

:)

jaynator495 (jaynator495):

NO

jaynator495 (jaynator495):

I WILL USE NOTEPAD

jaynator495 (jaynator495):

BECAUSE IM BEAST LIKE THAT TO DO AMAZING CODE ON NOTEPAD

jaynator495 (jaynator495):

DEAL WITH IT K

jaynator495 (jaynator495):

I have notepad++... literally never use it xD

jaynator495 (jaynator495):

used it for 5 minutes said no and continued in notepad xD

OpenStudy (lyrae):

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).

OpenStudy (malcolmmcswain):

^ true A good IDE is Coda 2 for mac And Microsoft Visual Studio for windows

OpenStudy (opcode):

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.

jaynator495 (jaynator495):

^... Well then -_-

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!