Question: In JavaScript - write a function to calculate 5 books times the price of one book, which is $10. Output (to the console), the total

In JavaScript - write a function to calculate 5 books times the price of one book, which is $10. Output (to the console), the total cost of the books. Need JS code as one and html SEPERATE - can't have js within html

I have this to start, but not working:

JS CODE:

function bookCost(quan, price){ return quan * price; } //write return (bookCost); //call

var quan = 5; var price = 10;

HTML CODE:

????

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!