Science, asked by ravindarreddy3363, 1 month ago

Create a JavaScript array which can hold salaries of three employees. Which of the following is the correct method
to do it?
Select one:
O var salaries = new Array(69435, 59839,90729)
O var salaries = new Array() values = 69435, 59839 90729
O var salaries = new (Array1 =69435, Array 2=59839 Array 3=90729)
O var salaries = new Array(1:69435, 2:59839 3:90729)​

Answers

Answered by pankajpal6971
0

Answer:

The correct option is A.) O var salaries = new Array(69435, 59839,90729)

Explanation:

  • A collection of elements can be stored in an object called an array. When you need to store a lot of the same type of data in one place, arrays come in incredibly handy.
  • Let's say you wish to keep records for 500 employees. You can accomplish the identical task with a single array as opposed to 500 variables if you use variables.
  • The index of an array's initial element is zero, and you can access the objects in an array by using its index number.
  • Numerous attributes and methods provided by the Array object enable developers to work with arrays quickly and effectively.

#SPJ2

Answered by hemakumar0116
0

Answer:

var salaries = new Array(69435, 59839,90729)

Explanation:

var salaries = new Array(69435, 59839,90729) Is the correct option..

An object known as an array may be used to hold a collection of items. Arrays are tremendously useful when you need to store a lot of the same kind of data in one location.

Say you want to maintain records for 500 workers. If you utilise variables, you would need 500 variables to do the same work as a single array.

You may access the elements of an array by using the index number of the array; the index of an array's first member is zero.

Developers can quickly and efficiently deal with arrays because to the Array object's numerous characteristics and methods.

#SPJ2

Similar questions