QP School

Full Version: JavaScript - Get the length of an array
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
const countries = [];

countries[0] = "Norway";
countries[1] = "Sweden";
countries[2] = "Finland";
countries[3] = "England";
countries[4] = "Scotland";
countries[5] = "Ireland";

document.write(countries.length);