Is there a 'best way' or 'standard way' to align JS objects?
Here are some different examples:
var boundBox = {x: click.x - boundBoxDefaultSize/2,
y: click.y - boundBoxDefaultSize/2,
width: boundBoxDefaultSize,
height: boundBoxDefaultSize }
var boundBox = {x: click.x - boundBoxDefaultSize/2,
y: click.y - boundBoxDefaultSize/2,
width: boundBoxDefaultSize,
height: boundBoxDefaultSize }
var boundBox = {x: click.x - boundBoxDefaultSize/2, y: click.y - boundBoxDefaultSize/2, width: boundBoxDefaultSize, height: boundBoxDefaultSize }
I highly recommend you this Style guide https://github.com/airbnb/javascript
So, your code should be as follows:
var boundBox = {
x: click.x - boundBoxDefaultSize/2,
y: click.y - boundBoxDefaultSize/2,
width: boundBoxDefaultSize,
height: boundBoxDefaultSize
};