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

  • Home
  • SEARCH
  • 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 9002731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:36:36+00:00 2026-06-16T00:36:36+00:00

Not sure if this is a dumb question. I’ve started playing with a few

  • 0

Not sure if this is a dumb question. I’ve started playing with a few JavaScript frameworks and I always get confused when I see an argument that is not being used inside a function.

A Backbone example (the model arg):

var Todo = Backbone.Model.extend({
  validate: function(attribs){
    if(attribs.title === undefined){
      return "Title can't be undefined";
    }
  },

  initialize: function(){
    console.log('This model has been initialized');
    this.on('error', function(model, error){
      console.log(error);
    });
  },
});

Express example (the req and next args):

app.use(function(err, req, res, next){
  console.error(err.stack);
  res.send(500, 'Something broke!');
});

So, I’m wondering, those values are just ignored? What would happen if you leave them out? And why they have to be included in the first place? (I’m used to the idea that if a function passes an argument is because it will be used in the function).

  • 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-16T00:36:37+00:00Added an answer on June 16, 2026 at 12:36 am

    In the case of initialize:

    The variable model isn’t used, but error is. Because error is the 2nd argument, model must be passed as a place holder.

    The same thing is true in use:

    The variable req isn’t used, but it is required as a place holder so res can be used.


    Why do the functions have parameters that don’t appear to be used?

    Maybe it’s for backwards compatibility or for extensibility.

    I assume these are both open source libraries (I’ve never used either).

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

Sidebar

Related Questions

I'm not sure this question is appropriate here but I hope I could get
This might be a dumb question but I'm just not sure about the answer.
This may seem like a dumb question, or even subjective, but I'm not sure
I'm sure this is a dumb question but Googling got me nowhere. Does each
Sorry for the dumb question, but I've been getting this on Xcode. I'm not
I'm new to python so this is probably a dumb question. I'm sure the
I am not sure whether I am asking a dumb question again or not
I am not sure if this general question is even allowed in here but
this is probably a dumb question, but wasnt too sure what else to do.
Not sure this is a known issue. I’m using VS2012 RC (Ultimate), and Win8

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.