Creating and calling function example

PHOTO EMBED

Fri Apr 21 2023 17:04:18 GMT+0000 (Coordinated Universal Time)

Saved by @AlanaBF #javascript

function getMilk (money) {
  // this will take take the money you put in and use the modula to find the change received (remainder) when you divide the money by 1.5 and return the total
  return money % 1,5;
}
// this variable saves the result of running the function
let change = getMilk(4)
content_copyCOPY