Javascript project 3 problem
You are making a currency converter app. Create a function called convert, which takes two parameters: the amount to convert, and the rate, and returns the resulting amount. The code to take the parameters as input and call the function is already present in the Playground. Create the function to make the code work. Sample Input: 100 1.1 Sample Output: 110 function convert(amount,rate){ let x = amount*rate; console.log(x); } function main() { var amount = parseFloat(readLine(), 10); var rate = parseFloat(readLine(), 10); console.log(convert(amount, rate)); } //now this whole code is giving me correct answer with undefined under the correct answer. But when i do return, instead of console.log(x). It gives me perfect answer without undefined written under.