JavaScript Algorithm: The Farm Problem

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.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store