Right now you have your else if for the temperature being a number nested inside the code that only runs when the temperature is not a number. In this case, if you add a log after your first if where you’re checking if temperature is not a number and another one after where you check if temperature is a number (before your switch statement), you’ll find that whenever you send it a valid number, you never reach the switch statement. One good spot would be after if conditions just to be sure you’re reaching the blocks of code you expect. You’d be able to compare the logging you add to the output you’re already getting to draw some conclusions. I think temporarily adding some logging to your function will help a lot with the debug process. ![]() at console.log(tempConverter('Ohyeah', 'Ohyeah')) Ģ4 hours later, if I try to go over the code or to even write the validation process all over again, I end up writing the very same things, so something is quite missing in my reasoning process, but… what exactly?Īnyways, thanks for those who got to read this far and even more thanks to those of you guys who can help me out of this one Temperature is not a number and you should choose a proper name for degrees.undefined at console.log(tempConverter(22, 'Ohyeah')).at console.log(tempConverter('a', 'Newton')) undefined at console.log(tempConverter(6, 'Newton')).undefined at console.log(tempConverter(68, 'Fahrenheit')).undefined at console.log(tempConverter(20, 'Celsius')).undefined at console.log(tempConverter(293, 'Kelvin')).This was my first attempt: // Temperature Converter 1Ĭonsole.log(`Today is $ degress Fahrenheit.` I then came back to the Temperature Converter ( Kelvin Weather) Project from the introduction unit and I started playing around with it to see if I’d properly grasps some of the concepts one sees in the following units. Want to convert a measurement to metric (or back)? Check out our handy conversion chart for the metric system.I’ve decided to come to a halt as I was trying to finish the last step of the Mini Linter Project Project (since I was kind of overwhelmed by it) to trace back my steps to the very beginning of the course and do some random practice in the way.Looking for some cooking conversions? This page has everything you need to know about easy substitutions and conversions in the kitchen.Did you know that crickets can tell you how warm it is outside? Find out how to tell the temperature from cricket chirps here! Another interesting temperature conversion is turning cricket chirps into degrees Fahrenheit. ![]() On the Celsius scale, water freezes at 0☌ and boils at 100☌ (at sea level). The Celsius temperature scale-originally called centigrade and later renamed for Swedish astronomer Anders Celsius-is used almost everywhere else in the world. On the Fahrenheit scale, water freezes at 32☏ and boils at 212☏ (at sea level). The Fahrenheit temperature scale is named for German physicist Daniel Gabriel Fahrenheit and is the measurement of temperature commonly used by the United States (and its associated territories) and by several nations in the Caribbean. Here are two handy charts that convert from F to C and also from C to F. To convert temperatures in degrees Celsius to Fahrenheit, multiply by 1.8 (or 9/5) and add 32. To convert temperatures in degrees Fahrenheit to Celsius, subtract 32 and multiply by.
0 Comments
Leave a Reply. |