Advertisement
kstoyanov

01. Fruit js advanced

Sep 16th, 2020
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. function solve(fruit, weight, money) {
  3.   const price = (weight * money) / 1000;
  4.  
  5.   console.log(`I need $${price.toFixed(2)} to buy ${(weight / 1000).toFixed(2)} kilograms ${fruit}.`);
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement