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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:20:02+00:00 2026-06-12T15:20:02+00:00

Having array of arrays var a = [[[1, alpha, a], [2, beta, b]], [[3,

  • 0

Having array of arrays

var a = [[[1, "alpha", "a"],
          [2, "beta",  "b"]],
         [[3, "gama",  "c"]],
         [[4, "delta", "d"]]];

var b = [];

1) How can I merge a[0] and a[2] into b?

2) How can I shuffle array b?


This is a shuffle algorithm I am using >>

Array.prototype.shuffle = function() {
  for (var i = 0; i < this.length; i++)
    this.push(this.splice(Math.random() * (this.length - i), 1)[0]);
  return this;
}

with syntax

myArray.shuffle();
  • 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-12T15:20:04+00:00Added an answer on June 12, 2026 at 3:20 pm

    To merge you can simply use concat.

    var b = a[0].concat(a[2]);
    

    For shuffling you need to write your own shuffling logic. There is no API for such.

    Shuffling –

    • How can I shuffle an array?
    • How to randomize (shuffle) a JavaScript array?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having a array like below var arrNames = [Stackoverflow,StackExchange,Webmaster,Programmers]; how should a template look
i am having a array called temparray and have 2 seperate arrays .i have
I'm having problems getting values in my multidimensional arrays Array ( [0] => Array
I having two arrays say, $array1 = array(code => E0089, desc => some description);
im having some weird problems with this arrays, what im trying to do first
I am having some trouble inserting an array into the sql database. my error
Arrays can be indexed using user-defined enumerated types. For example: type TIndexValue = (ZERO
I'm trying to pre-sort an array of items are added into an array using
Im having a weird issue with json arrays. Inside each array, there is another
I'm having some difficulty passing values and arrays between this two functions Here's the

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.