How to create arrays in javascript?



How to create arrays in javascript?..

Answer / Sheetal Kumari

Arrays can be created in JavaScript using square brackets `[]` with comma-separated values. For example, creating an array of numbers: `var arr = [1, 2, 3];`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

How do I install javascript?

1 Answers  


How to force a page to go to another page using javascript ?

1 Answers  


Create an array in javascript with a list of 4 colors, assign that array to the variable, ‘colors’.

1 Answers  


Which built-in method calls a function for each element in the array?

1 Answers  


How to capture the Image width and height using QTP script ? Kindly answer plz.... Thanx in adavance...

1 Answers  


How to delete an array entry using javascript?

1 Answers  


What are the variables in javascript?

1 Answers  


What are decodeuri() and encodeuri() functions in javascript?

1 Answers  


How can javascript codes be hidden from old browsers that don't support javascript?

1 Answers  


How you will add function as a property in a javascript object? Give an example.

1 Answers  


what difference between args.length and args.length() in command line argument?

1 Answers  


A milk carton can hold 3.78 litres of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one litre of milk is $0.38, and the profit of each carton of milk is $0.27. Write a java program that prompts the user to enter the total amount of milk produced in the morning. Then display the number of milk cartons needed to hold milk, the cost of producing milk, and the profit for producing milk.

1 Answers  


Categories