diff --git a/beyoncesAccountant.js b/beyoncesAccountant.js index 4029517..c466613 100644 --- a/beyoncesAccountant.js +++ b/beyoncesAccountant.js @@ -1,3 +1,6 @@ +var beyoncesMoney = 500 + 750 + 3000 + 5100 + 12980 + 9087 + 50000; + + console.log("Dear Beyonce,") console.log("We have calculated your total earnings this year.") console.log("You have earned " + beyoncesMoney) @@ -9,5 +12,4 @@ console.log("Of" + 500 + 750 + 3000 + 5100 + 12980 + 9087 + 50000 + " some porti // Now that we understand what a variable is // rewrite the above lines of code using a variable to store the // total sum, so that you don't have to add up all those numbers three times - - +totalSum = 500 + 750 + 3000 + 5100 + 12980 + 9087 + 50000; diff --git a/closure.js b/closure.js index 951f96e..10e637b 100644 --- a/closure.js +++ b/closure.js @@ -1,16 +1,19 @@ function parent() { var innerVariable = "Go to your room!"; console.log(inaccessible) - return function childe() { + return function child() { var inaccessible = "**sneaks out the bedroom window**"; return innerVariable; } } -var outerScope = parent; +//var outerScope = parent; -var innerScope = outerScope(); +//var innerScope = outerScope(); -innerScope(); +//innerScope(); +var parentFunction = parent; +var childFuntion = parentFunction; +childFuntion(); diff --git a/variables.js b/variables.js index 88e0d5e..0ed0939 100644 --- a/variables.js +++ b/variables.js @@ -1,15 +1,13 @@ -name = "Beyonce"; +var name = "Beyonce"; console.log(name); -var personality = "awesome" -console.log(personality) +var personality = "Motivated" +console.log(Motivated) // -personality = "fabulous"; +personality = "Individualistic"; console.log(personality); // Your Turn! // change the value of the `personality` variable to something that describes you // and console.log the new value - -