Skip to content

Instantly share code, notes, and snippets.

@cwetanow
Created November 18, 2018 08:29
Show Gist options
  • Save cwetanow/d901209da53045ce31a02c11740f1268 to your computer and use it in GitHub Desktop.
Save cwetanow/d901209da53045ce31a02c11740f1268 to your computer and use it in GitHub Desktop.
macros = [...$('.total')[0].children].splice(2, 3).map(el => +el.innerText);
cals = macros[0] * 4 + macros[1] * 9 + macros[2] * 4;
$('.total')[0].children[1].innerText = cals;
goalMacros = [...$('.total')[1].children].splice(2, 3).map(el => +el.innerText);
goalCals = goalMacros[0] * 4 + goalMacros[1] * 9 + goalMacros[2] * 4;
$('.total')[2].children[1].innerText = goalCals - cals;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment