Merge pull request #5474 from natac13/fix/varialble-data-persist-and-display-function-to-tail

Fix variable data persist on Functional Challenges.
This commit is contained in:
Rex Schrader
2016-01-02 16:59:29 -08:00

View File

@ -35,10 +35,6 @@
"", "",
" // Only change code below this line.", " // Only change code below this line.",
"", "",
"",
"",
" // Only change code above this line.",
"",
"};" "};"
], ],
"tail": [ "tail": [
@ -89,8 +85,6 @@
"", "",
"var MotorBike = function() {", "var MotorBike = function() {",
"", "",
"",
"",
"};" "};"
], ],
"tail": [ "tail": [
@ -219,10 +213,9 @@
"};", "};",
"", "",
"//Try it out here", "//Try it out here",
"var myCar;", "var myCar;"
"", ],
"// Only change code above this line", "tail": [
"",
"(function() {return JSON.stringify(myCar);})();" "(function() {return JSON.stringify(myCar);})();"
], ],
"solutions": [ "solutions": [
@ -293,9 +286,6 @@
"", "",
" // Only change code below this line.", " // Only change code below this line.",
"", "",
"",
"",
" // Only change code above this line.",
"};", "};",
"", "",
"var myCar = new Car();", "var myCar = new Car();",
@ -342,13 +332,13 @@
], ],
"challengeSeed": [ "challengeSeed": [
"var oldArray = [1,2,3,4,5];", "var oldArray = [1,2,3,4,5];",
"var newArray = [];",
"", "",
"// Only change code below this line.", "// Only change code below this line.",
"", "",
"var newArray = oldArray;", "newArray = oldArray;"
"", ],
"// Only change code above this line.", "tail": [
"",
"(function() {return newArray;})();" "(function() {return newArray;})();"
], ],
"challengeType": 1, "challengeType": 1,
@ -384,13 +374,13 @@
], ],
"challengeSeed": [ "challengeSeed": [
"var array = [4,5,6,7,8];", "var array = [4,5,6,7,8];",
"var singleVal = 0;",
"", "",
"// Only change code below this line.", "// Only change code below this line.",
"", "",
"var singleVal = array;", "singleVal = array;"
"", ],
"// Only change code above this line.", "tail": [
"",
"(function() {return singleVal;})();" "(function() {return singleVal;})();"
], ],
"challengeType": 1, "challengeType": 1,
@ -428,13 +418,13 @@
], ],
"challengeSeed": [ "challengeSeed": [
"var oldArray = [1,2,3,4,5,6,7,8,9,10];", "var oldArray = [1,2,3,4,5,6,7,8,9,10];",
"var newArray = [];",
"", "",
"// Only change code below this line.", "// Only change code below this line.",
"", "",
"var newArray = oldArray;", "newArray = oldArray;"
"", ],
"// Only change code above this line.", "tail": [
"",
"(function() {return newArray;})();" "(function() {return newArray;})();"
], ],
"challengeType": 1, "challengeType": 1,
@ -476,10 +466,9 @@
"", "",
"// Only change code below this line.", "// Only change code below this line.",
"", "",
"array.sort();", "array.sort();"
"", ],
"// Only change code above this line.", "tail": [
"",
"(function() {return array;})();" "(function() {return array;})();"
], ],
"challengeType": 1, "challengeType": 1,
@ -512,13 +501,11 @@
], ],
"challengeSeed": [ "challengeSeed": [
"var array = [1,2,3,4,5,6,7];", "var array = [1,2,3,4,5,6,7];",
"var newArray = [];",
"", "",
"// Only change code below this line.", "// Only change code below this line.",
"", "",
"var newArray = array;", "newArray = array;"
"",
"// Only change code above this line.",
""
], ],
"tail": [ "tail": [
"(function() {return newArray;})();" "(function() {return newArray;})();"
@ -549,15 +536,15 @@
], ],
"challengeSeed": [ "challengeSeed": [
"var oldArray = [1,2,3];", "var oldArray = [1,2,3];",
"var newArray = [];",
"", "",
"var concatMe = [4,5,6];", "var concatMe = [4,5,6];",
"", "",
"// Only change code below this line.", "// Only change code below this line.",
"", "",
"var newArray = oldArray;", "newArray = oldArray;"
"", ],
"// Only change code above this line.", "tail": [
"",
"(function() {return newArray;})();" "(function() {return newArray;})();"
], ],
"challengeType": 1, "challengeType": 1,
@ -587,13 +574,13 @@
], ],
"challengeSeed": [ "challengeSeed": [
"var string = \"Split me into an array\";", "var string = \"Split me into an array\";",
"var array = [];",
"", "",
"// Only change code below this line.", "// Only change code below this line.",
"", "",
"var array = string;", "array = string;"
"", ],
"// Only change code above this line.", "tail": [
"",
"(function() {return array;})();" "(function() {return array;})();"
], ],
"challengeType": 1, "challengeType": 1,
@ -615,6 +602,7 @@
"The following is an example of using <code>join</code> to join all of the elements of an array into a string with all the elements separated by word `Na`:", "The following is an example of using <code>join</code> to join all of the elements of an array into a string with all the elements separated by word `Na`:",
"<code>var joinMe = [\"Na \", \"Na \", \"Na \", \"Na \", \"Batman!\"];</code>", "<code>var joinMe = [\"Na \", \"Na \", \"Na \", \"Na \", \"Batman!\"];</code>",
"<code>var joinedString = joinMe.join(\"Na \");</code>", "<code>var joinedString = joinMe.join(\"Na \");</code>",
"<code>console.log(joinedString);</code>",
"Use the <code>join</code> method to create a string from <code>joinMe</code> with spaces in between each element and assign it to <code>joinedString</code>." "Use the <code>join</code> method to create a string from <code>joinMe</code> with spaces in between each element and assign it to <code>joinedString</code>."
], ],
"tests": [ "tests": [
@ -623,13 +611,13 @@
], ],
"challengeSeed": [ "challengeSeed": [
"var joinMe = [\"Split\",\"me\",\"into\",\"an\",\"array\"];", "var joinMe = [\"Split\",\"me\",\"into\",\"an\",\"array\"];",
"var joinedString = '';",
"", "",
"// Only change code below this line.", "// Only change code below this line.",
"", "",
"var joinedString = joinMe;", "joinedString = joinMe;"
"", ],
"// Only change code above this line.", "tail": [
"",
"(function() {return joinedString;})();" "(function() {return joinedString;})();"
], ],
"challengeType": 1, "challengeType": 1,
@ -640,6 +628,7 @@
"El siguiente es un ejemplo del uso de <code>join</code> para unir todos los elementos de un vector en una cadena con todos los elementos separados entre si por palabra` Na`: ", "El siguiente es un ejemplo del uso de <code>join</code> para unir todos los elementos de un vector en una cadena con todos los elementos separados entre si por palabra` Na`: ",
"<code>var uneme = [\"Na \", \"Na \", \"Na \", \"Na \", \"Batman!\"];</code>", "<code>var uneme = [\"Na \", \"Na \", \"Na \", \"Na \", \"Batman!\"];</code>",
"<code>var cadenaUnida = uneme.join(\"Na \");</code>", "<code>var cadenaUnida = uneme.join(\"Na \");</code>",
"<code>console.log(cadenaUnida);</code>",
"Usa el método <code>join</code> para crear una cadena a partir <code>joinMe</code> con espacios entre cada par de elementos y asignarla a <code>joinedString </code>." "Usa el método <code>join</code> para crear una cadena a partir <code>joinMe</code> con espacios entre cada par de elementos y asignarla a <code>joinedString </code>."
] ]
} }