diff --git a/challenges/01-front-end-development-certification/basic-bonfires.json b/challenges/01-front-end-development-certification/basic-bonfires.json index 1cf13be43f..a9f8842d69 100644 --- a/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/challenges/01-front-end-development-certification/basic-bonfires.json @@ -365,25 +365,25 @@ "Remember to use Read-Search-Ask if you get stuck. Write your own code." ], "challengeSeed": [ - "function repeat(str, num) {", + "function repeatStringNumTimes(str, num) {", " // repeat after me", " return str;", "}", "", - "repeat(\"abc\", 3);" + "repeatStringNumTimes(\"abc\", 3);" ], "tests": [ - "assert(repeat(\"*\", 3) === \"***\", 'message: repeat(\"*\", 3) should return \"***\".');", - "assert(repeat(\"abc\", 3) === \"abcabcabc\", 'message: repeat(\"abc\", 3) should return \"abcabcabc\".');", - "assert(repeat(\"abc\", 4) === \"abcabcabcabc\", 'message: repeat(\"abc\", 4) should return \"abcabcabcabc\".');", - "assert(repeat(\"abc\", 1) === \"abc\", 'message: repeat(\"abc\", 1) should return \"abc\".');", - "assert(repeat(\"*\", 8) === \"********\", 'message: repeat(\"*\", 8) should return \"********\".');", - "assert(repeat(\"abc\", -2) === \"\", 'message: repeat(\"abc\", -2) should return \"\".');" + "assert(repeatStringNumTimes(\"*\", 3) === \"***\", 'message: repeatStringNumTimes(\"*\", 3) should return \"***\".');", + "assert(repeatStringNumTimes(\"abc\", 3) === \"abcabcabc\", 'message: repeatStringNumTimes(\"abc\", 3) should return \"abcabcabc\".');", + "assert(repeatStringNumTimes(\"abc\", 4) === \"abcabcabcabc\", 'message: repeatStringNumTimes(\"abc\", 4) should return \"abcabcabcabc\".');", + "assert(repeatStringNumTimes(\"abc\", 1) === \"abc\", 'message: repeatStringNumTimes(\"abc\", 1) should return \"abc\".');", + "assert(repeatStringNumTimes(\"*\", 8) === \"********\", 'message: repeatStringNumTimes(\"*\", 8) should return \"********\".');", + "assert(repeatStringNumTimes(\"abc\", -2) === \"\", 'message: repeatStringNumTimes(\"abc\", -2) should return \"\".');" ], "type": "bonfire", "isRequired": true, "solutions": [ - "function repeat(str, num) {\n if (num < 0) return '';\n return num === 1 ? str : str + repeat(str, num-1);\n}\n\nrepeat('abc', 3);\n" + "function repeatStringNumTimes(str, num) {\n if (num < 0) return '';\n return num === 1 ? str : str + repeatStringNumTimes(str, num-1);\n}\n\nrepeatStringNumTimes('abc', 3);\n" ], "MDNlinks": [ "Global String Object"