0

Javascript_Functions_'Currency Converter' Code Project

Hello. I'm doing the final project in the Functions Sections of the JavaScript Tutorial. I don't understand how the predetermined code starts. It begins like this: "function main() { var amount = parseFloat(readLine(), 10); var rate = parseFloat(readLine(), 10);" What is parseFloat? What is readLine? Why is that there? I can't find those concepts explained elsewhere. Also, at the end, it says: " console.log(convert(amount, rate));" What does "convert" refer to?

19th Jan 2022, 6:07 PM
Matías Edgardo Negro
1 ответ
0
parseFloat is used to convert a string into a floating-point number
30th Jan 2022, 1:51 PM
Cristian Baeza Jimenez
Cristian Baeza Jimenez - avatar