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 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 I was wondering if there were any way to upload images in ASP?
Hey, I'm using Levenshteins algorithm to get distance between source and target string. also
Hey, in the Programming Pearls book, there is a source code for setting, clearing
Hey im wondering why I am receiving the following error in my rss feed
Hey I was wondering if anyone can point me to some example on how
Hey i was wondering if anyone had any insight on how to crop an
Hey I was wondering if anyone could help to save the value of my
Hey I was wondering if it was possible to maintain a changelog for a
Hey I was wondering if I have to do anything else with the icon
Hey guys quite new to smarty and was wondering if i could load templates

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.