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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:58:38+00:00 2026-06-02T15:58:38+00:00

I am trying to create an array in jQuery, which is filled through a

  • 0

I am trying to create an array in jQuery, which is filled through a loop.

count = jQuery('#count_images').val();

With the above code I get an integer value (such as 5, for example).
What I would like to know, is how I can do something like this in jQuery:

int arrLength = count;
string[] arr1 = new string[arrLength];
int i = 0;
for (i = 0; i < arr1.Length; i++){
    arr1[i] = i;
}

So in the end my array for example 5 would look like this: [1,2,3,4,5].

  • 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-02T15:58:39+00:00Added an answer on June 2, 2026 at 3:58 pm

    Description

    This is more about javascript and not jquery.
    Check out my sample and this jsFiddle Demonstration

    Sample

    var arrLength = 5;
    var arr1 = [];
    var i = 0;
    
    for (i = 0; i != arrLength; i++){
      arr1.push(i)
    }
    
    alert(arr1.length)
    

    More Information

    • JavaScript Array Tutorial
      ​
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create an array of class objects taking an integer argument.
I am trying to create an array which will follow something like this array(
I'm trying to create an array which will hold the hours in a day
I'm trying to create a function that uses jQuery to get height of image,
I'm trying to create a list links using jquery. I'm using this code to
OK, I'm trying to get the loop of each array after selecting them... the
Using the jQuery SelectBox plugin I'm trying to create a JSON object which looks
I'm trying to create a function in PHP which would go through CSS and
I am trying to create a JavaScript ARRAY, and get the name of an
Im trying to create an array of tm* structs, and then return them at

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.