FULL STACK CODING PROGRAM

JOIN OUR PROGRAM AND BUILD YOUR CAREER IN TECH WITH EDULADDER.


NEW JOINEES WILL RECIVE CRYPTO WORTH OF RS 5000/-.


WHITE PAPER APPLY NOW HERE

Real Problems! Real Experts!

An unparalleled, New approach On creative thinking and problem solving.


The Eduladder is a community of students, teachers, and programmers just interested to make you pass any exams. So we help you to solve your academic and programming questions fast.
In eduladder you can Ask,Answer,Listen,Earn and Download Questions and Question papers.
Watch related videos of your favorite subject.
Connect with students from different parts of the world.
Apply or Post Jobs, Courses ,Internships and Volunteering opportunity. For FREE
See Our team
Wondering how we keep quality?
Got unsolved questions? Ask Questions

Javascript-Interview-questions-->View question

How to create an array in js and how to read array elements?

How to create an array in js and how to read array elements?


Asked On2019-08-30 03:19:15 by:priyanshu0208

Taged users:
RajivAnkitagayathriadarinadeembabuofficialJumboPerumalSelectron

Likes:
Be first to like this question

Dislikes:
Be first to dislike this question
Talk about this  Like  Dislike
View all questions
Answers
There are a couple of ways to append an array in JavaScript:
  1. 1) The push() method adds one or more elements to the end of an array and returns the new length of the array. ...
  2. 2) The unshift() method adds one or more elements to the beginning of an array and returns the new length of the array: var a = [1, 2, 3]; a.

Answerd on:2019-06-24 Answerd By:priyanshu0208

Likes:
Be first to like this answer

Dislikes:
Be first to dislike this answer
Talk about this  Like  Dislike

You might like this video:Watch more here

Watch more videos from this user Here

Learn how to upload a video over here

What is an Array?
An array is a special variable, which can hold more than one value at a time.

If you have a list of items (a list of car names, for example), storing the cars in single variables could look like this:

var car1 = "Saab";
var car2 = "Volvo";
var car3 = "BMW";
However, what if you want to loop through the cars and find a specific one? And what if you had not 3 cars, but 300?

The solution is an array!

An array can hold many values under a single name, and you can access the values by referring to an index number.

Creating an Array
Using an array literal is the easiest way to create a JavaScript Array.

Syntax:

var array_name = [item1, item2, ...];       

Answerd on:2019-06-26 Answerd By:avi738

Likes:
Be first to like this answer

Dislikes:
Be first to dislike this answer
Talk about this  Like  Dislike

You might like this video:Watch more here

Watch more videos from this user Here

Learn how to upload a video over here



Lets together make the web is a better place

We made eduladder by keeping the ideology of building a supermarket of all the educational material available under one roof. We are doing it with the help of individual contributors like you, interns and employees. So the resources you are looking for can be easily available and accessible also with the freedom of remix reuse and reshare our content under the terms of creative commons license with attribution required close.

You can also contribute to our vision of "Helping student to pass any exams" with these.
Answer a question: You can answer the questions not yet answered in eduladder.How to answer a question
Career: Work or do your internship with us.Work with us
Create a video: You can teach anything and everything each video should be less than five minutes should cover the idea less than five min.How to upload a video on eduladder