[Solved] Javascript variable functions


Since this code is littered with ternary operators, that seems to be what you are having the most trouble with.

Basic syntax:

condition ? a : b

is the same as

if (condition) {
  a
} else {
  b
}

For weight: If you want to use kilo, just remove that whole line and set a equal to parseFloat($("[name=Weight]").val()).

Same goes for height.

You are correct in assuming that changes to male are on the left side of the colon and changes to female are on the right. However you would have to post exactly what you are trying to change it to and your desired result if you expect any further assistance.

1

solved Javascript variable functions