

- Weight converter pounds to kilogram code#
- Weight converter pounds to kilogram download#
- Weight converter pounds to kilogram free#

Weight converter pounds to kilogram code#

Delete the contents of the app.js file.
Weight converter pounds to kilogram download#
Download the source code from the github repository above.This project uses around 20 lines of JavaScript code, including white space and code comments. This project took me about 25 minutes to code out the solution. Also, explore many other unit converters or learn more about weight and mass unit conversions.
Weight converter pounds to kilogram free#
In realty, since I applied the type=”number” attribute to my HTML input element, I don't think I needed to check for NaN.īut, I supposed it's always good practice to use JavaScript for data validation, instead of HTML.Īnyway, it was a fun refresher and I challenge you to get it done as well. Free online weight and mass converter - converts between 70 units of weight and mass, including kilogram kg, gram g, milligram mg, ton (metric) t, etc. In other words, it's as if you're asking JavaScript if (true = false). In review, in JavaScript, NaN is NOT equal to NaN.

Just like in the previous project, I had to use the isNaN() function. Since this project is very similar to the previous BMI calculator project, I had no issues other than forgetting a few things. I actually didn't watch the author's solutions so I don't know for sure if he used inline JavaScript like he did for previous projects. To find the fishs weight (or mass) in pounds, we convert its weight from kilograms to pounds by using the unit rate lb2.2kg where lb is the number of pounds. Once you give the value to your calculator and press the enter key, your calculator returns the value of your weight in kilograms. The calculator requires just one input, your weight in pounds. The objective of this JavaScript project is to wire up a very basic JavaScript weight conversion calculator.
