Essential JavaScript

Going Further

Array Length

Like strings, arrays have a length property.

const letters = ['a', 'b', 'c', 'd']; console.log(letters.length);
const numbers = [1, 2, 3, 4, 5, 6]; console.log(numbers.length);

Learning Goals

  • I can access the length of an array

Code Editor

Click "Run Code" to execute your JavaScript in a secure sandbox and see the output below.

Console Output

// Console output will appear here...

0 output lines