let array.length vs array.length

Edit on GitHub

Setup

let myArray = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];

Tests

  • let array.length

    let l = myArray.length;
    for (let i = 0; i < l; ++i) {
        let j = myArray[i];
    }
  • array.length

    for (let i = 0; i < myArray.length; ++i) {
        let j = myArray[i];
    }