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.
Смотрите видео LOOPS, CONDITIONALS, THIS, & RETURN | Simple Javascript Project Training Tutorial онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Powerslacker 29 Ноябрь 2016, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 2,412 раз и оно понравилось 15 людям.