From 9039cbaa1b88773b89376627a0d03d21f8119be4 Mon Sep 17 00:00:00 2001 From: Rex Schrader Date: Tue, 5 Jan 2016 15:50:22 -0800 Subject: [PATCH] Stand In Line - Improve Clarity --- .../basic-javascript.json | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/challenges/01-front-end-development-certification/basic-javascript.json b/challenges/01-front-end-development-certification/basic-javascript.json index 81fc7cc565..fe285a20b5 100644 --- a/challenges/01-front-end-development-certification/basic-javascript.json +++ b/challenges/01-front-end-development-certification/basic-javascript.json @@ -2043,7 +2043,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": [ @@ -2063,32 +2063,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