Skip to content

Instantly share code, notes, and snippets.

@Catevika
Last active December 1, 2020 10:29
Show Gist options
  • Save Catevika/0d3d02f8a3061aac3d6d2a664c1349bf to your computer and use it in GitHub Desktop.
Save Catevika/0d3d02f8a3061aac3d6d2a664c1349bf to your computer and use it in GitHub Desktop.
December 2020 - 24 days JavaScriptmas_challenge#1_candies
const candies = (children, candy) => children > 0 && candy > 0 ? Math.floor(candy / children) * children : console.log('For Christmas, number of children and candies must be greater than 0 to spread joy and happiness');
const result = candies(3, 10);
console.log('result: ', result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment