From 49524583ac9df642d92244b6f63a0145d175934c Mon Sep 17 00:00:00 2001 From: Dustin Patterson Date: Fri, 4 Oct 2019 20:54:59 -0600 Subject: [PATCH] Declaring variables I noticed you switched between `var` and `let` throughout the doc. Thought this might help some students understand what those mean. Horray for Hacktoberfest! --- app.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app.js b/app.js index 8eed74e..3b42bec 100644 --- a/app.js +++ b/app.js @@ -1,3 +1,17 @@ +//Declaring Variables +var oldWay = true; // Using 'var' allows you to change the value of 'oldWay' to anything, at anytime. +// EXAMPLE +// oldWay = 1; (valid) +// oldWay = 'coding is fun'; (valid) +const canNotChange = true; // ES6 - Once a 'const' is set, it cannot be changed. Best practice to use when a value should never change. +// EXAMPLE +// canNotChange = 1; (NOT VALID) +let canBeUpdated = true; // ES6 - Using 'let' will allow you to change the value anytime you want. +// EXAMPLE +// canBeUpdated = 1; (valid) +// canBeUpdated = 'CodeWorks is awesome'; (valid) + + //DataTypes //Value Types (Primative Types)