JavaScript Algorithm: The Farm Problem

How to count legs…

Max N

--

Photo by Brett Jordan on Unsplash

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.

--

--

Max N

A writer that writes about JavaScript and Python to beginners. If you find my articles helpful, feel free to follow.