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,

It looks like this puzzle is missing the par and score auto fill options (for me at least). When I try to type it in manually my entry is rejected.

Hey there,

Part of completing this puzzle is manually adding the parameters, which you will need to type yourself. Can you tell me more about what happens when the parameters are rejected? Is there a message displayed at all?


Got it, rather than pressing done I was trying to separate the two parameters with a comma manually. Thats what caused the rejection.

1 Like

Hello, to calculate score in golf, it should be score - par. I gave myself a realistic score of one over par 4, 3 and it returns -1. It made me question everything I knew!

Thanks, loving this app.

Thanks for the tip! To be honest, there aren’t a lot of golfers on staff here at Grasshopper.


1 Like

Save it for when you’re retired like everyone else. Looks like you need a little more diversity!

Thanks for the reply

1 Like

I am not able to manually write in the parameters

Hello there, this puzzle is still bugged. It doesn’t let me insert numbers, all options are blocked for underPar() function and it doesn’t recognize when I try it manually.

Awaiting feedback. Thanks

@Raikiry Could you post a screenshot of your code? Then i could look at it and see if something is wrong with the code.

1 Like

It is just the base code but it blocks the section to insert the numbers. From what I looked around, it might be missing an () in the function+underPar()

This should work.

function underPar(score, par) {
return par - score:
console.log(underPar(3, 4));

1 Like

First, doubleclick on the gray box in the parentheses after underPar. Type score in it and hit enter. In the next blank that pulls up type par. Underneath that click on the boxes in that whateveryoucallit box.Click on return par - score. Then modify the console.log(underPar()), change it to console.log(underPar(3, 4)). Make sure that you use the num button in the whateveryoucallit box for the numbers.


This is what my code looks like.

ps: In the console.log the numbers don’t have to be 3 and 4. I think they can be any number you want it to be (provided the number fits in the box. I don’t know how many characters they limit it at.).


Thank you for the explanation and help. Now I understand what I was doing wrong. :slight_smile:


There are no score and par values in toggle box