From 11fee2aa0fd8bfc67812cb51b24846359d9612bd Mon Sep 17 00:00:00 2001 From: Louis Joe Date: Fri, 9 Oct 2020 21:55:06 +0000 Subject: [PATCH] Done. --- index.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/index.js b/index.js index 765e13650..96736b083 100644 --- a/index.js +++ b/index.js @@ -1,32 +1,32 @@ var animal = 'dog' - + function myAnimal() { - // You should not need to modify this function return animal } - + function yourAnimal() { - // The tests expect this function to return `animal` just like the previous function - // However, you cannot simply modify the existing variable declared on line 1 in the global scope + var animal = 'cat' // How can we make sure that this function // and the above function both pass? - // P.S.: Hard-coding 'cat' below will not work + // P.S.: You can't just hard-code 'cat' below return animal } - + function add2(n) { - return n + two - - // Feel free to move things around! const two = 2 + return parseInt(n, 10) + two + + // Feel free to move things around! + } - + var funkyFunction = function() { return function() { return "FUNKY!" } } - -// We want to set theFunk equal to "FUNKY!" using our funkyFunction. -// NOTE: you only need to modify the code below this line. -var theFunk = funkyFunction + +// We want 'funkyFunction' on the line below to return a function that returns "FUNKY!" -- how can we accomplish that? +// NOTE: To pass this final test, you only need to modify the code below this line. +var theFunk = funkyFunction()() +theFunk = theFunk() \ No newline at end of file