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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:10:48+00:00 2026-06-15T14:10:48+00:00

hi friends when I m initializing multidimensional array I am getting error can’t convert

  • 0

hi friends when I m initializing multidimensional array I am getting error

can’t convert undefined to object

when i use push() method to assign value to array element instead of —> test[i][j]=’hi’;
then it returns error => test[i] undefined
the only thing i want is to intialize array with some dummy data

    $(document).ready(function (){
       // accordian......
            $(function() {
            $( "#accordion1" ).accordion();
        });

        syncMenu(function(group,subgroup,items){
            grp=group;
            sub_groups=subgroup;
            sub_items=items;        
        });
// get data after parsing using ajax
        getPacakage(function(temp){
            sel_pkg_group=temp;
            fillOptionList();
        });
// intailizing array ...        
        for(var i=0;i<10;i++){
            for(var j=0;j<2;j++){
                test[i][j]='hi';
                            test[i][j]='hi';
            }
        }

    });
  • 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-15T14:10:50+00:00Added an answer on June 15, 2026 at 2:10 pm

    test and test[] are undefined, so you’ll need to define them first:

    var test = [];
    for (var i = 0; i < 10; i++) {
        test[i] = [];
        for (var j = 0; j < 2; j++) {
            test[i].push('hi');
        }
    }
    

    Now you can use push() to push values to test[i].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Friends On HP-UX box when Iam passing a string object to function Im getting
Friends, Can you please give me significance, difference and uses for Heap and PermGen.
Friends, I like to know using which version of Android SDK we can develop
Friends In, testing of Apple Push Notification Service ,server sends me response .k that
Friends, I am trying to use DyGraph in my application. Please look at the
Friends I am getting two inputs from the user 1.InitDate from DatePicker 2.Difference in
Friends, Now i am using google API for getting the Location Info.I am getting
I'm making an app where you can post in your friends' facebook wall, the
Friends, I'm new to both Javascript and Regular Expressions and hope you can help!
Friends please help. I know that using jdk1.7 we can get the last access

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.