Skip to content

Instantly share code, notes, and snippets.

@InputNeuron
Created January 17, 2017 01:03
Show Gist options
  • Select an option

  • Save InputNeuron/1e0a10b40d142699f945383ad7cab7f0 to your computer and use it in GitHub Desktop.

Select an option

Save InputNeuron/1e0a10b40d142699f945383ad7cab7f0 to your computer and use it in GitHub Desktop.
var remaining = 0;
for(var i = 0; i < lessons_left.length; ++i) {
var current = lessons_left[i];
var text = current.textContent;
var idx = text.indexOf("/");
if (idx > 0) {
remaining += parseInt(text.substr(idx + 1))
}
}
console.log("You have N lessons remaining: " + remaining);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment