You have been hired by a football team to create a function that calculates their points based on the number of wins, draws and losses. The points system is as follows:
- A win earns the team 3 points
- A draw earns the team 1 point
- A loss earns the team 0 points
Write a function called calculatePoints that takes in 3 arguments:
- wins (a number): representing the number of wins the team has
- draws (a number): representing the number of draws the team has
- losses (a number): representing the number of losses the team has
The function should log the total number of points the team has earned based on the above points system.
calculatePoints(5,2,3); // Output: 17
For example, if the team has won 5 games, drawn 2 games and lost 3 games, their total points would be: (5 x 3) + (2 x 1) + (3 x 0) = 17.
Your function should return the log 17.
Good Luck ๐