JavaScript Algorithm: The Farm Problem
We create a function called animals
that accepts three integers: chickens
, cows
, and pigs
.
In this problem, you are given the number of chickens, cows, and pigs a farmer has on his farm. The goal of the function is to output the number of legs of all the animals on the farm.