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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:46:58+00:00 2026-05-25T18:46:58+00:00

As shown in the image, I just do inArray on an array, looking for

  • 0

enter image description here

As shown in the image, I just do inArray on an array, looking for a node. and $previously_selected_node and the item at index 37 in $shapes are the same object…. so… why isn’t it working?

EDIT:
I found another way to search after one of the aswerers postedd his answer:

var result = -1;
jQuery.each(shapes, function(key, value){
    if (value.id == shape.id){
        result = key;
    }
});
return result;

apparently, part of my problem is that I can’t return in the middle of a loop. (I was returning the instant a match was found, which was causing some issues.)

  • 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-25T18:46:58+00:00Added an answer on May 25, 2026 at 6:46 pm

    Your object is not an array.
    $.inArray only work on array-like objects with a length and a set of properties named 0 through length – 1.

    You need to search your non-array manually.
    For example, you could use a for / in loop to loop through all properties that actually exist and see if any of them match your object:

    for (var key in $shapes) {
        if ($shapes[key] === yourObject) {
            //Match!
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small flash file that just loads and shows one image scaled
I would like to have a table header that looks like the image shown
How would I have a top right corner div as shown in the image.
I need to create some mini-windows, like the ones shown in the image bellow,
I am binding an Image.Source property to the result of the property shown below.
See this Image below http://i46.tinypic.com/2pt6jkn.jpg This is report in SSRS as shown when it
I'm trying to perform a skew on an image, like one shown here (source:
I just added an image resource to my assembly via the Resources tab in
Best shown with an image, I can drag the forms off the edge of
As shown in the image, I have a view 1 in the buttom containing

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.