diff --git a/seed/challenges/01-front-end-development-certification/basic-javascript.json b/seed/challenges/01-front-end-development-certification/basic-javascript.json index e0f3cfd7ec..f80c9ab23c 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -2049,7 +2049,7 @@ "title": "Stand in Line", "description": [ "In Computer Science a queue is an abstract Data Structure where items are kept in order. New items can be added at the back of the queue and old items are taken off from the front of the queue.", - "Write a function queue which takes an \"array\" and an \"item\" as arguments. Add the item onto the end of the array, then remove the first element of the array. The queue function should return the element that was removed." + "Write a function queue which takes an array (arr) and a number (item) as arguments. Add the number to the end of the array, then remove the first element of array. The queue function should then return the element that was removed." ], "releasedOn": "January 1, 2016", "head": [ @@ -2069,32 +2069,33 @@ "capture();" ], "challengeSeed": [ - "// Setup", - "var myArr = [1,2,3,4,5];", - "", "function queue(arr, item) {", " // Your code here", " ", " return item; // Change this line", "}", "", + "// Test Setup", + "var testArr = [1,2,3,4,5];", + "", "// Display Code", - "console.log(\"Before: \" + JSON.stringify(myArr));", - "console.log(queue(myArr, 6)); // Modify this line to test", - "console.log(\"After: \" + JSON.stringify(myArr));" + "console.log(\"Before: \" + JSON.stringify(testArr));", + "console.log(queue(testArr, 6)); // Modify this line to test", + "console.log(\"After: \" + JSON.stringify(testArr));" ], "tail": [ "uncapture();", - "myArr = [1,2,3,4,5];", + "testArr = [1,2,3,4,5];", "(function() { return logOutput.join(\"\\n\");})();" ], "solutions": [ - "var myArr = [ 1,2,3,4,5];\n\nfunction queue(myArr, item) {\n myArr.push(item);\n return myArr.shift();\n}" + "var testArr = [ 1,2,3,4,5];\n\nfunction queue(arr, item) {\n arr.push(item);\n return arr.shift();\n}" ], "tests": [ "assert(queue([],1) === 1, 'message: queue([], 1) should return 1');", "assert(queue([2],1) === 2, 'message: queue([2], 1) should return 2');", - "queue(myArr, 10); assert(myArr[4] === 10, 'message: After queue(myArr, 10), myArr[4] should be 10');" + "assert(queue([5,6,7,8,9],1) === 5, 'message: queue([5,6,7,8,9], 1) should return 5');", + "queue(testArr, 10); assert(testArr[4] === 10, 'message: After queue(testArr, 10), myArr[4] should be 10');" ], "type": "checkpoint", "challengeType": 1