FULL CODE + IMAGES + SLIDES @ http://blog.breakthru.solutions/learn...
PLAYLIST: • Learn Javascript with a SIMPLE Projec...
FOLLOW ME ON TWITTER: / thepowerslacker
Variables, Arrays, &
Objects
Variables
Store data for later use
Have names and values
Declared with the var, let or const keywords
let & const are not implemented yet but can be used with Babel
Can store text (strings), numbers, booleans, and even functions
Example: var animal = ‘zebra’;
Arrays
Variables that store multiple values.
Can store any type of valueJust like variables
Example: var animals = [‘zebra’, ‘monkey’, ‘lion’];
Brackets [ ]Declare variables by using brackets on the ends
Access values with positionanimals[1] // returns monkeyAnimals[2] // returns lion
Objects / Hashes
Key-value pairs
Declared with braces { }
Access with key
Example:
var animals = {
‘jeffery’: ‘zebra’,
‘gordo’: ‘monkey’,
‘harambe’: ‘lion’
};
animals.harambe OR animals[‘harambe’] // returns lion
Tip
When using dynamic values (values that aren’t preset by you), use the brackets to access an object..
Watch video VARIABLES, ARRAYS, & OBJECTS | Simple Javascript Project Tutorial & Training online without registration, duration hours minute second in high quality. This video was added by user Powerslacker 29 November 2016, don't forget to share it with your friends and acquaintances, it has been viewed on our site 7,164 once and liked it 37 people.