Skip to content

Instantly share code, notes, and snippets.

@psiphi75
Last active March 29, 2017 00:01
Show Gist options
  • Save psiphi75/1622a957a351fd49213f10322ccda609 to your computer and use it in GitHub Desktop.
Save psiphi75/1622a957a351fd49213f10322ccda609 to your computer and use it in GitHub Desktop.
fuction vector(x, y) {
this.x = x;
this.y = y;
}
const a = new vector(1, 2);
const b = new vector(3, 4); // OKAY: b has the same hidden class as a
b.z = 5; // BAD: b now has a different hidden class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment