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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:01:13+00:00 2026-06-10T20:01:13+00:00

I believe that what I’m trying to do is declare several arrays within an

  • 0

I believe that what I’m trying to do is declare several arrays within an array.
In a text document, I have the following:

"一","いち","one"
"二","に","two"
"三","さん","three"
"四","し・よん","four"
"五","ご","five"

Which I want to automatically place into an array with the items assigned as groups of 3, so for instance set_one[0][1] would be “いち”, set_one[3][2] would be “four”, so on.

For the life of me, I cannot figure out how to even read the values line by line from the plain text document, let alone try to automatically assign them into arrays.. so I tried manually. I have:

var set_one = new Array(new Array("一", "いち","one"), new Array("二", "に","two", new Array("三", "さん","three", new Array("四", "よん・し","four", new Array("五", "ご","five");

Which, when document.write(set_one[3][2]); is called, nothing happens what-so-ever.. I even tried a for loop to see if anything exists in the (set_one) array at all, though as far as I can tell, nothing does.

It’s difficult working on this windows machine to say the least, as I have no debugging tools available, and it doesn’t have an active Internet connection! What am I doing wrong? Is there a better way of doing this? Is it even possible to read the values into an array automatically line-by-line, then assign the values to individual arrays based on the comma values?

  • 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-10T20:01:15+00:00Added an answer on June 10, 2026 at 8:01 pm

    You’re not creating the array correctly. For example, when you have:

    new Array("二", "に","two", new Array("三", "さん","three"))
    

    You are actually creating a single-element array, in which the 3rd position is itself another array. Either use:

    new Array (new Array("二", "に","two"), new Array("三", "さん","three"))
    

    Or the much simpler, and less confusing way of creating arrays in JavaScript:

    var set_one = [ 
      [ "一","いち","one" ],
      [ "二","に","two" ],
      [ "三","さん","three" ],
      [ "四","し・よん","four" ],
      [ "五","ご","five" ] 
    ];
    set_one[0][1]; // いち
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used to believe that any variable that is shared between two threads, can
I can't believe that the following statement seems to be still true So, I
I believe that most of you have heard of preloading of images. But is
I am trying to learn more about BindingList because I believe that it will
I believe that out there we have algorithms implementations (e.g. a c++ implementation of
I believe that if I declare a HashMap and repeatedly feed it instances of
I believe that one needs to buy a license(?) to use devexpress. I'm currently
I believe that one of the biggest advantages of using CI is capability of
I believe that no question is silly if it is bugging you. I have
I believe that I have incorrectly used a combination of float, margin and background

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.