Into the Putts explainer

Aim of the puzzle: Add parameters to a function declaration.
Walk through of solution: A parameter is a special type of variable that is used to specify the input of a function.

Parameters are defined inside the parentheses () of a function declaration, and behave like a variable inside a function. They only exist inside the function declaration.

In this puzzle, the underPar() function has 2 parameters, score and par. The function then returns the par minus the score.

At the bottom of the code, the function is called with 2 arguments, for example, 10 and 11. Whichever number is placed in the parentheses first will serve as the score (as that is the first parameter), and the second number will become the par. The function will then return 11 - 10, or 1.
Sample code solution:

function underPar(score, par) {
    return par - score;

console.log(underPar(10, 11));

Javascript Concepts: Parameters, Arguments, Functions, Return Statements

Hallo, my code in „Into the Putts“ is correct, but I cannot go on.
My code:
function underPar(par, score) {
return par - score;
console.log(underPar(5, 4));

It Workshop and the result is 1.
There must be a bug in the program.

Hey there, try updating the app to the current version. There was a bug preventing this puzzle from working properly, and the fix was released a few weeks ago.

If you update the app and this puzzle is still not working, please let me know.


Seems to still be acting weird for me. Won’t let me input score or par, or if it does, it changes par to score or vise versa

Hmm, try submitting a bug report through the app.

Try running the code in the puzzle once or twice, then tap on the menu button in the top-right of the screen, then “Send Feedback” ==> “Report a Problem”.

A bug report will send us Grasshopper’s logs, which we can use to figure out what is going on under the hood.

Thanks for your patience,