Challenge Write Reusable JavaScript with Functions has an issue.
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
// Example
function reusableFunction() {
console.log("Hi World");
}
reusableFunction();
// Only change code below this line
function reusableFunction1() {
console.log("Hi World");
}
reusableFunction1();
Instructions
Create a function called reusableFunction which prints "Hi World" to the dev console.
Call the function.
But I found that objective was to make changes in existing reusableFunction() instead of creating new reusableFunction1().
Seems, Instructions are inappropriate.
Also have a look at comment in code, which says
// Only change code below this line
However, the activity expects to modify exisitng reusableFunction which is above this line.
Thanks.
Somewhat related to #8526. General theme is that the instructions need to be updated.
Yeah @erictleung I agree this one is a bit on the overwhelming side.
Looks like this challenge need refactoring.
How about something:
// Example
function reusableFunction() {
console.log("Hi World");
}
reusableFunction();
// Only change code below this line
function greetFunction() {
reusableFunction();
}
greetFunction();
And of course change the instructions and the tests to reflect the same, that the reusableFunction is indeed being reused?
Or do you suggest something more intuitive for a camper.
@raisedadead, as i said before
// Only change code below this line
However, your approach still expects to modify exisitng reusableFunction which is above this line.
And your approach is too complicated for beginner to understand.
You can also do the following,
let user create his own function and let him call that...You can check if output is these two lines from two called functions.
Heya, World
Hi World
Yes we could do that, the problem is our current testing framework would need some overhaul for this. For instance if we do not have a well defined function, then user would simply pass the challenge with
console.log('Heya, World');
console.log('Hi World');
And the tests would be looking for these outputs.
I am not against this, but unless someone is up for modifying the way current infrastructure for detecting if a function was defined or not, which realistically speaking may not be happening soon.
So we need at least one well defined function for the challenge seed. Campers may define any no of re-usable functions and call them.
@raisedadead @erictleung We can update the instructions as
Change the function called
reusableFunctionso that it prints"Hello World"to the dev console.
@pranayberry Umm tha'ts not gonna solve the objective, IMHO. Rather changing the instruction and seed is needed here. (BTW seed is that code which appears in the code editor)
@raisedadead Will this work..?

Okay, I went through this once again.
And here is what we need:

@raisedadead I noticed same issue with the next challenge also ie the instructions are not clear.
I have done the changes you previewed with this challenge.
@raisedadead
Previous


Updated


Should I proceed with the PR ?
@erictleung, @pranayberry, @raisedadead, @ceejayoz
Either slightly renaming either function or saying "rewrite the function, changing the contents of the string to ..... " would be helpful in this case.

A recent PR #9485 has fixed this issue. The PR has been merged and will be pushed to the live site soon. So closing this issue as resolved. Happy coding all!
what is dev console help me please
I know; I went there to tell you in person.
On Mon, Sep 10, 2018 at 12:27 PM Hassan Ali notifications@github.com
wrote:
what is dev console help me please
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/freeCodeCamp/freeCodeCamp/issues/8551#issuecomment-419973805,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AI700Xi82kGkfoKrRI8zdqEhyJ5dhGhGks5uZpLkgaJpZM4IbR0Q
.