From 548f672064a38e4019afff71b026a55065efd7ba Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Sun, 21 Aug 2016 16:46:03 -0400 Subject: [PATCH] control if/else and stubs for functions as objects --- javascript.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/javascript.md b/javascript.md index b7bb31d..f5b7f05 100644 --- a/javascript.md +++ b/javascript.md @@ -151,7 +151,26 @@ To make it exact, use `===` ``` ## Control Flow (loops, if/else) + +We can use equality in if/else statements + +```javascript +if(1 === 2){ + console.log('should not run'); +} else if (1 === 3){ + console.log('also should not run'); +} else { + console.log('runs if all else fails'); +} +``` + ## Functions are objects + +- can be assigned to variables +- can be assigned to properties of objects +- can be passed as parameters to other functions +- closures + ## Events ## Callbacks ## Asynchronicity