Saturday, January 27, 2018

JavaScript (cont'd)

Some useful things to know about JavaScript:
The styling name conventions are not identical to those of CSS;
one needs to use camel case directives ie 'backgroundColor'
and not background-color!! Javascript predates CSS.

It is possible to change a string to a number. By default,
everything is a string, but if one adds the + operator, it
will behave as a number.( Other operations will happen
as expected).

One can parse input from the user, as with the BMI code
below.As always, the devil is in the details, and one needs to
worry about decimal places (enter numbers in metric).







No comments: