Assign-object vs Assign-explicit

Edit on GitHub

Setup

var point = {x: 99.0, y: 36.0, z: 19.5};

Tests

  • Assign-object

    Object.assign({}, point, {x: point.x + 15, z: point.z + 3.0});
  • Assign-explicit

    { x: point.x + 15, y: point.y, z: point.z + 3.0}