Skip to content

Instantly share code, notes, and snippets.

@loganhenson
Created March 27, 2020 17:51
Show Gist options
  • Select an option

  • Save loganhenson/dfd08d69dff5defe46e30bc8f9a7b76c to your computer and use it in GitHub Desktop.

Select an option

Save loganhenson/dfd08d69dff5defe46e30bc8f9a7b76c to your computer and use it in GitHub Desktop.
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}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment