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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:27:06+00:00 2026-06-18T00:27:06+00:00

I have an array (took from an API) with near 300 values, but I

  • 0

I have an array (took from an API) with near 300 values, but I need to call someAction() with sets of 10 values. I mean, 1-10, 11-20, 21-30… and so. I was limiting it to 10, but other 290 values were lost.
Its a multidimensional array.

var n = 10; // Limit of names
for (var i = 0; i < n; i++) {
    namestr += names[i].first + "(" + names[i].nick + ")";
    if(i != (n-1)){namestr += ", ";}
}
someAction(namest, function(){...});

Thanks for your help

  • 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-18T00:27:07+00:00Added an answer on June 18, 2026 at 12:27 am

    If you just want to call someAction on every 10 elements you might do this:

    for (var i = 0; i < names.length; i+=10) {
        someAction(names.slice(i, i+10));
    }
    

    Based on your comment, you could do this:

    for (var i = 0; i < names.length; i+=10) {
        var tmp = names.slice(i, i+10);
        for (var j = 0; j < tmp.length, j++) {
            tmp[j] = tmp[j].first + " (" + tmp[j].nick + ")";
        }
        someAction(tmp.join(","));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the response from service url and I took them into array.I have
I have a search suggestion code that I have took from one of the
I have a empty hidden div that will include information from an AJAX call.
I have a problem in sorting table from information took from SQL database. I
I have a script of snow for the site, I took it from this
I have array that need to sort by their appearance, as they are written
In an array like int a[5] we can store 5 values from a[0] to
I have array INPUTFILES with n files INPUTFILES=( file_0 ... files_n-1 ) And i
I have array of hashes: @array = [{:id => 1, :status=>R}, {:id => 1,
I have array of select tag. <select id='uniqueID' name=status> <option value=1>Present</option> <option value=2>Absent</option> </select>

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.