loganhenson
2/26/2019 - 11:11 PM

deficit-calc.js

console.clear();

const weight = 163; // lbs
const height = 182; // cm
const age = 27;

// Basal metabolic rate (calories you would use just sleeping all day)
const bmr = Math.floor(66 + (13.7 * (0.453592 * weight)) + (5 * height) - (6.8 * age));

// Total daily energy expenditure (includes a multiplier for a sedentary remote dev XD)
const tdee = Math.floor(bmr * 1.2);

// how many calories you are "dieting by"
const deficit = 500;

console.log(`bmr: ${bmr}`, `tdee: ${tdee}`);
console.log();
console.log(`Daily Calories: ${tdee - deficit}`);