New answers tagged

0

Make use of this small project to separate core logic from UI. You can have a class Calculator which retains current state, and your UI is just a way to display this class. To do this, just think your design as if you were to replace UI by CLI. You have to be able to unplug your UI, plug CLI, and your calculator has to work the same. This is also, I think, ...


4

First off, my basic maths is a bit rusty, but is radix correct? Shouldn't Math.pow(x,1/y) be Math.pow(y,1/x)? I'm not a big fan of "extending" the native Math object. The Math object isn't a regular JavaScript object so you shouldn't assume that all implementations will allow you to add new properties to it. It would be better to create your own object and ...


Top 50 recent answers are included