Created
January 17, 2017 01:03
-
-
Save InputNeuron/1e0a10b40d142699f945383ad7cab7f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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