function validArgument(n) {
return typeof n === 'number' && n >= 0;
}
function calculateFoodOrder(numAnimals, avgFood) {
if (validArgument(numAnimals) && validArgument(avgFood)) {
return numAnimals * avgFood;
}
return -1;
}
scripts: {
"feed:update": "@php artisan feed:update"
}