Created
November 6, 2017 20:12
-
-
Save rawsh/6111d00b376e35a654ed050ca0a04188 to your computer and use it in GitHub Desktop.
get most expensive item on http://www.theodoregray.com/PeriodicTable/Elements/006/index.html
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 pricelist = []; | |
| for (var i=0; i < bs.length; i++) { | |
| if(bs[i].childNodes[0].nodeValue === "Price:") { | |
| if (bs[i].nextSibling.nodeValue.charAt(1) === "$") { | |
| pricelist.push(parseInt(bs[i].nextSibling.nodeValue.substr(2))); | |
| } | |
| } | |
| } | |
| console.log(Math.max(...pricelist)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment