From e9683bb318645ec7289eb7d78478d47818853bbb Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Tue, 15 Mar 2016 23:54:56 -0700 Subject: [PATCH] Make Confirm the Ending function name unique - Change `end` function name to `confirmEnding` - Add clarity on arguments used in function --- .../basic-bonfires.json | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-bonfires.json b/seed/challenges/01-front-end-development-certification/basic-bonfires.json index eb11c40fb6b..8a77de4f6d3 100644 --- a/seed/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/basic-bonfires.json @@ -321,31 +321,31 @@ "id": "acda2fb1324d9b0fa741e6b5", "title": "Confirm the Ending", "description": [ - "Check if a string (first argument) ends with the given target string (second argument).", + "Check if a string (first argument, str) ends with the given target string (second argument, target).", "Remember to use Read-Search-Ask if you get stuck. Write your own code." ], "challengeSeed": [ - "function end(str, target) {", + "function confirmEnding(str, target) {", " // \"Never give up and good luck will find you.\"", " // -- Falcor", " return str;", "}", "", - "end(\"Bastian\", \"n\");" + "confirmEnding(\"Bastian\", \"n\");" ], "tests": [ - "assert(end(\"Bastian\", \"n\") === true, 'message: end(\"Bastian\", \"n\") should return true.');", - "assert(end(\"Connor\", \"n\") === false, 'message: end(\"Connor\", \"n\") should return false.');", - "assert(end(\"Walking on water and developing software from a specification are easy if both are frozen\", \"specification\") === false, 'message: end(\"Walking on water and developing software from a specification are easy if both are frozen\", \"specification\") should return false.');", - "assert(end(\"He has to give me a new name\", \"name\") === true, 'message: end(\"He has to give me a new name\", \"name\") should return true.');", - "assert(end(\"He has to give me a new name\", \"me\") === true, 'message: end(\"He has to give me a new name\", \"me\") should return true.');", - "assert(end(\"He has to give me a new name\", \"na\") === false, 'message: end(\"He has to give me a new name\", \"na\") should return false.');", - "assert(end(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") === false, 'message: end(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") should return false.');" + "assert(confirmEnding(\"Bastian\", \"n\") === true, 'message: confirmEnding(\"Bastian\", \"n\") should return true.');", + "assert(confirmEnding(\"Connor\", \"n\") === false, 'message: confirmEnding(\"Connor\", \"n\") should return false.');", + "assert(confirmEnding(\"Walking on water and developing software from a specification are easy if both are frozen\", \"specification\") === false, 'message: confirmEnding(\"Walking on water and developing software from a specification are easy if both are frozen\", \"specification\") should return false.');", + "assert(confirmEnding(\"He has to give me a new name\", \"name\") === true, 'message: confirmEnding(\"He has to give me a new name\", \"name\") should return true.');", + "assert(confirmEnding(\"He has to give me a new name\", \"me\") === true, 'message: confirmEnding(\"He has to give me a new name\", \"me\") should return true.');", + "assert(confirmEnding(\"He has to give me a new name\", \"na\") === false, 'message: confirmEnding(\"He has to give me a new name\", \"na\") should return false.');", + "assert(confirmEnding(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") === false, 'message: confirmEnding(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") should return false.');" ], "type": "bonfire", "isRequired": true, "solutions": [ - "function end(str, target) {\n return str.substring(str.length-target.length) === target;\n};\n" + "function confirmEnding(str, target) {\n return str.substring(str.length-target.length) === target;\n};\n" ], "MDNlinks": [ "String.substr()"