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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:12:19+00:00 2026-05-15T18:12:19+00:00

var asdf:Array = [ [1,1] ]; trace( asdf.indexOf( [1,1] ) ); // -1 Why

  • 0
var asdf:Array = [ [1,1] ];
trace( asdf.indexOf( [1,1] ) ); // -1

Why can’t indexOf() find the [1,1] array?

  • 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-15T18:12:19+00:00Added an answer on May 15, 2026 at 6:12 pm

    Here is a little function I wrote a while ago that works great. I included a lot of comments and an example search/function to output the results.

    // set up a multidimensional array that contains some data
    var myArray:Array = new Array();
    myArray.push(["granola","people... are great"," 4 ","10"]);
    myArray.push(["bill","orangutan","buster","keaton"]);
    myArray.push(["steve","gates","24","yes, sometimes"]);
    myArray.push(["help","dave","jobs","hal"]);
    
    // here we set up some properties on the array object to hold our search string and our results
    myArray.myTarget = "steve";
    myArray.myResults = [];
    
    // now we call the search
    myArray.forEach(multiSearch);
    
    // this is the function that does all the heavy lifting....
    function multiSearch(element:*, index:int, array:Array)
    {
        // see if we have a match in this array and pass back its index
        for(var i:* in element)
        {   
            if( element[i].indexOf( array.myTarget ) > -1 )
            {
                var tempArray:Array = array.myResults;
                tempArray.push([index,i]);
                array.myResults = tempArray;
            }
        }
    }
    
    // -------------------------------------------------------------------------------
    // all the code below is OPTIONAL... it is just to show our results
    // in the output window in Flash so you know it worked....
    var printArray:Array = myArray.myResults;
    for(var i:* in printArray)
    {
        trace("TARGET FOUND @: "+printArray[i][0]+", "+printArray[i][1]+" = "+myArray[ printArray[i][0] ][ printArray[i][1] ]); 
    }
    // -------------------------------------------------------------------------------
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

var asdf = a[3] > b[5] > c[1] function removebracket(){ var newstring = asdf.replace(/\/[^\/]*$/,
var fruit = [apple,pear,pear,pear,banana]; How do I remove all pear fruit from this array?
Consider the following text: var t=asdf t1 : v1 xasdf dfas sdf t2 :
Let's say I have a class: var asdf = new Class({ myFunction: function ()
I have a string var str= 'asdf<br>dfsdfs<br>dsfsdf<br>fsfs<br>dfsdf<br>fsdf'; I want to replace <br> with \r
I have the following node.js files: //test.js: var hash=require('./hash'); var sys=require('sys'); sys.puts(hash.hash(asdf,asdf)); and //hash.js:
I have the following two Node.js files: //test.js var hash=require('./hash'); var sys=require('sys'); hash.hash(asdf,function(param){ sys.puts(param);
Say I have this JSON object: var images = {success:true, images:[ {id:1234,url:asdf,tags:[cookie,chocolate]}, {id:5678,url:qwer,tags:[pie,pumpkin]} ]};
var ref1 = new Firebase(http://gamma.firebase.com/myuser/123,456); ref1.set(123,456); var on1 = ref1.on(value, function(snapshot) { console.log(snapshot.val()); });
var gethtml = $(#topmenu > li.l89 a).text().split(' ')[1].replaceWith('Any World'); The text is not changing

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.