.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
satyapriyanayak
SP
Sambanthamoorthy
Ashutosh Jha
Imran Ghani

Home >> Interview Question >> JavaScript/VBScript >> Post New Question Subscribe to Interview Questions

How do you declare 2 dimensional array in Javascript?

Posted By :nishithraj     Posted Date :November 30, 2009    Points :10   Category :JavaScript/VBScript 
myarray[0][0]="Compaq 486"
myarray[0][1]="Compaq 586"
myarray[0][2]="Compaq 686"
myarray[1][0]="Dell 486"
myarray[1][1]="Dell 586"
myarray[1][2]="Dell 686"
myarray[2][0]="IBM 486"
myarray[2][1]="IBM 586"
myarray[2][2]="IBM 686"

You can also find related Interview Question to How do you declare 2 dimensional array in Javascript?  below: 

How do you initialize a two-dimensional array that you don't know the dimensions of?

  
int [ , ] myArray; //declaration
myArray = new int [5, 8]; //actual initialization (More...)

How to declare an array for int?

  
int[] n;
Here,
int -- Data Type
[] -- Name of the Array
n -- name

(More...)

Is it Possible to declare an array variable without initialization?

  
Yes. It is possible .Use "New" keyword.
Eg:
int[] myArray;
myArray = new int[] {1,3,5,7,9}; (More...)

How do you check if a variable is an array in JavaScript

  
if (i2 instanceof Array) {
alert('v1 is Array!');
} else {
alert('i2 is not an array');
} (More...)

What is the difference between ARRAY and STACK?

  
STACK follows LIFO. Thus the item that is first entered would be the last removed.

In array the items can be entered or removed in any order. Basically each member access is done using index. No strict order is to be followed here to remove a particular element. (More...)

Why do we Use a Multidimensional Array?

  
A multidimensional array can be useful to organize subgroups of data within an array. In addition to organizing data stored in elements of an array, a multidimensional array can store memory addresses of data in a pointer array and an array of pointers.

Multidimensional arrays are used to store information in a matrix form.
e.g. a railway timetable, schedule cannot be stored as a single dimensional array.
One can use a 3-D array for storing height, width and length of each room on each floor of a building. (More...)

I thought destructors didn't exist in C#.Why can I declare one?

  
You can declare a method that looks like a C++ destructor such as ~Employee(). But it really becomes a shorthand way to define System.Object.Finalize.The Finalize method is not the same as a C++ destructor.A short explanation is that C++ destructors are called when the call stack unwinds.The Finalize method will be called when the garbage collector of the CLR is ready to destroy the object. (More...)

What's the difference between the System.Array.CopyTo() and System.Array.Clone() in c#?

  
The first one performs a deep copy of the array, the second one is shallow. (More...)

What Are the Generic Methods of System.Array?

  
The System.Array type is extended with many generic static methods. The generic static methods are designed to automate and streamline common tasks of working with arrays, such as iterating over the array and performing an action on each element, scanning the array looking for a value that matches a certain criteria (a predicate), converting and sorting the array, and so on. Below is a partial listing of these static methods (More...)

How can you sort the value of the array in descending order?

  
First call Sort() and then Reverse() methods. (More...)

When do you have to declare a class as abstract?

  
1. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden.
2. When at least one of the methods in the class is abstract. (More...)

What's the difference between the System.Array.CopyTo() and System.Array.Clone()?

  
The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identacle object. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend