Write the JavaScript code that will create/declare an array…
Write the JavaScript code that will create/declare an array named “intervals” that is initially empty. Use a FOR loop to populate that array with the sequence 2, 4, 6, 8, 10, 12 (every element goes up by another 2). At the end of the FOR loop, the list should have 6 elements. Here’s how to lose points on this question: – The array is not initially empty.- At the end of the program, the array does not have 6 elements.- The elements are not as described above.- The program does not populate the array from within a FOR loop.
Read Details