MaxArt 616 days ago. link 1 point ▲ ▼This is off topic. Anyway, the given code *does* render a perfectly centered button. Use button.getBoundingClientRect() to verify that.
MaxArt 619 days ago. link 1 point ▲ ▼Small correction: // 3 * obj.nonexistentProperty === undefined It's actually === NaN.