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


Top 5 Contributors of the Month
david stephan

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

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

Posted By :Ashutosh Jha     Posted Date :July 29, 2014    Points :40   Category :JavaScript/VBScript 
if (i2 instanceof Array) {
alert('v1 is Array!');
} else {
alert('i2 is not an array');
}

You can also find related Interview Question to How do you check if a variable is an array in JavaScript  below: 

How do you declare 2 dimensional array in Javascript?

  
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" (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...)

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...)

How can we check that some changes have been made to dataset since it was loaded?

  


The changes made to the dataset can be tracked using the GetChanges and HasChanges methods.
GetChanges():
-------------
The GetChanges returns dataset which are changed since it was loaded or since Acceptchanges was executed.

HasChanges():
------------
The HasChanges property indicates if any changes were made to the dataset since it was loaded or if acceptchanges method was executed.

RejectChanges():
----------------
The RejectChanges can be used to revert thee changes made to the dataset since it was loaded

(More...)

What is Check Constraint?

  
Check constraint specifies a condition that is enforced for each row of the table on which the constraint is defined. Once constraint is defined, insert or update to the data within the tables is checked against the defined constraint
(More...)

What is the difference between RULE and Check Constraint?

  
The major difference between rule and Check is reusability. Check constraint is associated with columns in a Table. So these can't be re-used. Rules are defined with in a database and can be applied to any number of columns. (More...)

How to remove a Session variable?

  
using HttpSessionState.Remove(); (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...)

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