javascript array size

#include <iostream>

int main() {
    // Declare an array of integers with a fixed size of 5
    int arraySize = 5;
    int myArray[arraySize];

    // Initialize the array with values
    for (int i = 0; i < arraySize; ++i) {
        myArray[i] = i * 2;
    }

    // Access and print the elements of the array
    std::cout << "Array elements: ";
    for (int i = 0; i < arraySize; ++i) {
        std::cout << myArray[i] << " ";
    }

    return 0;
}
// Declare an array of integers with a fixed size of 5
const arraySize = 5;
let myArray = new Array(arraySize);

// Initialize the array with values
for (let i = 0; i < arraySize; ++i) {
    myArray[i] = i * 2;
}

// Access and log the elements of the array
console.log("Array elements: " + myArray.join(" "));