When a form button is clicked,...

this function is called ...

and 'this', referring to the button clicked, is passed as argument,...

coming in as 'bt'.

First, the function 'tonumeric' is called to distill numeric data from what's been typed in the text boxes.

Since the first entry has to be valid at all times and parseFloat doesn't guarantee that, we use 'isNaN' (is not a number) to check and throw an exception if it's not.

This exception can be caught in the clc function.

Without an exception, the program continues.

The button's id is used in a 'switch' to determine which of the cases is to be executed.

This one, if the first button was clicked.

Raising to a power, calculating the square root, determining highest value, determining the remainder of a division...

and some this and that to show calculating possibilities.

The 'breaks' are necessary to get out of the switch,...

to this line.

* , / and % have precedence over + and - , but round brackets have an even higher precedence, as in math.

Math is one of the JavaScript objects containing lots of useful methods and such, like 'round', 'max', 'min', 'sin', 'cos' and many more.

Add 11.1 to the result so far, += implies...
` res = res + 11.1 ;`

Calculate what's to the right of '*=' and multiply that value by 'res'. Math.random returns a fractional number between 0 and 1, Math.round rounds to the nearest integer value.