I am wearing my beloved HTML Programmer hoodie and my My Neighbor Totoro socks, and I am completely ready to start learning more about Functions. Yep. Except now I'm listening to Roy Mette's Pirates (of the East Coast of the Americas and the Caribbean Sea and I just want to spend all my time chilling out to "Jean Lafitte" But I said I'd learn more JavaScript, and by god, I'm gonna. Function ParametersI am very amused that they keep on using the "Fahrenheit to Celsius" example. But it's so good at showing you how you can put parameters into your functions. function toCelsius(farenheit) { return (5/9) * (farenheit-32); } let value = toCelsius(77); document.getElementById("demo").innerHTML = "The value is " + value; You can keep on changing that number in toCelsius to be anything, and the function will keep chugging along, changing your temperature to Celsius. It also says that functions can have as many parameters as you want, as long as you separate them by commas, but the examples…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.