Jump to content
Sign in to follow this  
Den356

What is the parameters in arroy function?

Recommended Posts

Hello everyone,

please help the newbie figure it out.

There is such a JS code.

function makeDouble (x) {

return x * 2; }

var doMath = (x, func) => func(x + 5);
var num = 5;

The task is this:
Using only makeDouble, doMath, and num, make the value of num equal to 20.

num = _____________________________________________________

I can’t understand why there are two parameters in the arrow function, but in the body of this function itself there is only one parameter. What am I doing wrong?

Share this post


Link to post
Share on other sites

The variable "func" is being used as a function in the body.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...