Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8054293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:06:54+00:00 2026-06-05T08:06:54+00:00

I just started learning js from EloquentJavascript I need 2 answers to help me

  • 0

I just started learning js from EloquentJavascript
I need 2 answers to help me pass this example:

function makeAddFunction(amount) {
  function add(number) {
    return number + amount;
  }
  return add;
}

var addTwo = makeAddFunction(2);
var addFive = makeAddFunction(5);
show(addTwo(1) + addFive(1));

Question 1:

Can we just add () after variable meaning to add argument to the function that the variable represent? like addTwo(1) means makeAddFunction(1)?

Question 2:

makeAddFunction(2) means amount = 2, then what’s the value for number? If I pick a section of the above example, what will return in the following section?

function makeAddFunction(2) {
  function add(number) {
    return number + 2;
  }
  return add;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:06:55+00:00Added an answer on June 5, 2026 at 8:06 am

    Can we just add () after variable meaning to add argument to the function that the variable represent? like addTwo(1) means makeAddFunction(1)

    Nope. addTwo(1) equals to makeAddFunction(2)(1)

    makeAddFunction(2) means amount = 2, then what’s the value for number? in the following example2, what will return?

    You pass it additionally, when call addTwo or addFive

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm Java person who just started learning Python. Take this example: class Person(): def
I just started learning C++ and I wrote this sample program from the text
I just started learning C++(coming from Java & Python) and am trying to learn
I just started learning C++ (coming from Java ) and am having some serious
Just I started learning MVC pattern, of course i am learning it from Microsoft's
I just started learning C but I don't understand this part of the code.
I've just started learning jQuery/javascript, so this might seem like a really basic question,
I have just started learning django. I created a form from django models. On
G'Day Programmers, I am from Java background however I have just started learning C++
Just started learning PySide and is having problem with QTimer I have this #!/usr/bin/python

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.