From e6455d73f88f636a8f6da82adb85fa821021b2f3 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Sun, 21 Aug 2016 15:36:43 -0400 Subject: [PATCH] variables section for JS --- javascript.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/javascript.md b/javascript.md index 007a7ac..f98615c 100644 --- a/javascript.md +++ b/javascript.md @@ -20,6 +20,21 @@ undefined // undefined ``` ## Variables + +Declaring variables is done with the keyword `var`. Variables are dynamically typed (decided during execution) since there is no compilation process. + +```javascript +var foo = 'string'; +var bar = 1; +``` + +Variables can be reassigned to any other value by omitting the var keyword + +```javascript +var foo = 'a string'; +foo = 123.4; +``` + ## Functions and Scope ## Objects/Arrays ## Equality