everything is ready except OOP

This commit is contained in:
Quincy Larson
2015-10-28 05:13:49 -07:00
parent 44c77d65b1
commit d2ce2275b3
5 changed files with 110 additions and 80 deletions

View File

@@ -109,13 +109,17 @@
],
"challengeSeed":[
"var Car = function() {",
" this.gear = 1;",
"",
" gear = 1;",
"",
" function addStyle(styleMe){",
" return 'The Current Gear Is: ' + styleMe;",
" }",
"",
" this.getGear = function() {",
" return addStyle(this.gear);",
" };",
"",
"};",
"",
"var Bike = function() {",
@@ -123,10 +127,11 @@
" // Only change code below this line.",
"",
" this.speed = 100;",
"",
" function addUnit(value) {",
" return value + \"KM/H\";",
" }",
" ",
"",
" getSpeed = function () {",
" return addUnit(speed);",
" };",
@@ -203,6 +208,9 @@
"",
"",
"",
"",
"",
"",
"// Only change code above this line.",
"",
"(function() {return array;})();"
@@ -221,7 +229,7 @@
"To use <code>reduce</code> you pass in a callback whose arguments are an accumulator (in this case, <code>previousVal</code>) and the current value (<code>currentVal</code>).",
"<code>reduce</code> has an optional second argument which can be used to set the initial value of the accumulator. If no initial value is specified if will be the first array element.",
"Here is an example of <code>reduce</code> being used to sum all the values of an array:",
"<code>var singleVal = array.reduce(function(previousVal, currentVal){</code>",
"<code>var singleVal = array.reduce(function(previousVal, currentVal) {</code>",
"<code>&thinsp;&thinsp;return previousVal+currentVal;</code>",
"<code>});</code>",
"Use the <code>reduce</code> method to sum all the values in <code>array</code> and assign it to <code>singleVal</code>."
@@ -239,6 +247,9 @@
"",
"",
"",
"",
"",
"",
"// Only change code above this line.",
"",
"(function() {return singleVal;})();"