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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:17:37+00:00 2026-06-03T15:17:37+00:00

this code http://jsfiddle.net/minagabriel/5MQ77/ var flowShadeBigArray =[] ; var x = [7, 411, 780] var

  • 0

this code http://jsfiddle.net/minagabriel/5MQ77/

     var flowShadeBigArray =[] ;
          var x = [7, 411, 780]
          var y = [286, 712, 1058]

        for( var i = 0 ; i< x.length;i++){

            for(var index = x[i]; index <= y[i] ; index++ ){

                 var temp = [] ; 

                temp.push(index) ; 
                flowShadeBigArray.push(temp); 


            }

        }
        console.log(JSON.stringify(flowShadeBigArray));

generate the following array

 [[7],[8],[9],[10],[11],[12],[13],[14]................[1056],[1057],[1058]]

i want to create a three arrays inside flowShadeBigArray and have the [x[i] ... y[i] ]
grouped together:

example

[  [  [7]....[286] ] , [ [411]...[712] ] ,[ [780]...[1058] ] ]

NOTE i still need to keep each of these numbers as an array so i can use it an an index for something else

THANKS

  • 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-03T15:17:38+00:00Added an answer on June 3, 2026 at 3:17 pm

    Just move the temp initialization to the first loop, before the second, and the .push() to the first loop after the second (or before, doesn’t matter).

    var flowShadeBigArray = [];
    var x = [7, 411, 780]
    var y = [286, 712, 1058]
    
    for (var i = 0; i < x.length; i++) {
        var temp = [];
    
        for (var index = x[i]; index <= y[i]; index++) {
            temp.push(index);
        }
        flowShadeBigArray.push(temp);
    }
    

    http://jsfiddle.net/5MQ77/1/

    If each individual number belongs in its own Array, then change this:

    flowShadeBigArray.push(temp);
    

    to this:

    flowShadeBigArray.push([temp]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code : http://jsfiddle.net/VAkLn/6/ When i add a table : http://jsfiddle.net/VAkLn/7/ this
This is my code: http://jsfiddle.net/WCP5f/2/ If you open it with Chrome, you will see
This is my fiddle code http://jsfiddle.net/coderslay/WnC9B/44/ It is successfully plotting the graph. The problem
I'm running this code in Firefox 11 on Windows 7. (See http://jsfiddle.net/QStkd/ ). $('<div><input
example: http://jsfiddle.net/kuTLf/ code looks like this: <div id=main> <div id=slideshow class=pics> <div id=nav></div> <img
In here, http://jsfiddle.net/sjKgF/78/ JS CODE $('.display_box').hover(function (){ $(this).attr('class', 'display_box current') }, function (){ $(this).attr('class',
This is my code http://jsfiddle.net/Cfa6c/8/ Basically what I need to do is get the
I have this code: http://jsfiddle.net/bUPWS/1/ but #div2 overflows #div1. How to bring the overflowed
not sure what is wrong with this jquery code: http://jsfiddle.net/aCABM/ I want to to
All of this is code is here: http://jsfiddle.net/yrgK8/ I have a news section which

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.