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 876199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:23:45+00:00 2026-05-15T11:23:45+00:00

Hey, I was wondering if setting an object equal to $.extend(), but setting the

  • 0

Hey, I was wondering if setting an object equal to $.extend(), but setting the target to the same object is redundant?

 setOptions(options = $.extend({
        classPrefix: 'imgareaselect',
        movable: true,
        resizable: true,
        parent: 'body',
        onInit: function () {},
        onSelectStart: function () {},
        onSelectChange: function () {},
        onSelectEnd: function () {}
    }, options));
  • 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-05-15T11:23:46+00:00Added an answer on May 15, 2026 at 11:23 am

    They way you’ve coded it, it’s not redundant. That’s because the first object passed in is the one that’s modified, so all of the properties in options are being copied to the anonymous object you pass in as the first parameter. So you would then need to assign the return value of $.extend to something in order by be able to actually use it. If you’d done it the other way around:

    $.extend(options, { ... });
    

    Then the assignment is redundant. Note also that the order you pass objects in is important. By doing it the way you’ve done it, the anonymous object is basically the “defaults” and anything in options will override them.

    Finally, because you’re passing the result to a call to setOptions (which I assume saves the value somewhere) you also don’t need an explicit assignment to options. But that depends entirely on what setOptions does and what you need options for later…

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

Sidebar

Related Questions

Hey Just wondering how the following can happen Object reference not set to an
Hey just wondering how I can draw multiple rectangle objects in C# but have
Hey guys I was wondering if someone could provide a little help. I've been
Hey all. I'm wondering how to implement a timeout event in the System.Windows.Forms.Webbrowser control?
Hey all, I am wondering what the best way to do the following is:
Hey, I was wondering if anybody knew how to alter the following XSL stylesheet
Hey all, I'm just wondering if it is possible to get the name of
Hey there, was wondering if anyone could help a newbie on SQL and Python.
Hey, I was wondering how to set the focus to a text box in
Hey, I'm just wondering if there's any easy function to make text suitable to

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.