LOOPS, CONDITIONALS, THIS, & RETURN | Simple Javascript Project Training Tutorial

Published: 29 November 2016
on channel: Powerslacker
2,412
15

FULL CODE + IMAGES + SLIDES @ http://blog.breakthru.solutions/learn...

PLAYLIST:    • Learn Javascript with a SIMPLE Projec...  

FOLLOW ME ON TWITTER:   / thepowerslacker  

Loops, conditionals, this, & return

Loops

Loops allow us to repeat code
Functions let us reuse code once, loops allow us to reuse the same code many times
Two common loops to most languages are ‘for loops’ and ‘while loops’
Loops check a condition to keep running

Conditionals

If / Else & Switch Statements
If / Else
Executes code inside once, only if a condition is true
A default case can be executed if the condition is not true, this is called else
You can also use elseif if you have multiple conditions that you want to check - though this gets messy quick

Switch
Similar to if / else but much cleaner syntax
Very useful when checking multiple conditions

This
The hardest simple thing to understand
The ‘this’ keyword refers to the object that is currently being executed.
Tricky to use properly and can be a source of many headaches!
For more info check out the video by mpj

   • bind and this - Object Creation in Ja...  

Return
Ends a function and sends the value after the return back to where the function was originally called.


Watch video LOOPS, CONDITIONALS, THIS, & RETURN | Simple Javascript Project Training Tutorial 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 2,412 once and liked it 15 people.