object vs array

Edit on GitHub

Setup

x1 = {y: 1, z: 2};
x2 = [1, 2]

Tests

  • object

    x1.x
  • array

    x2[0]