Skip to content

Instantly share code, notes, and snippets.

@rawsh
Created November 6, 2017 20:12
Show Gist options
  • Select an option

  • Save rawsh/6111d00b376e35a654ed050ca0a04188 to your computer and use it in GitHub Desktop.

Select an option

Save rawsh/6111d00b376e35a654ed050ca0a04188 to your computer and use it in GitHub Desktop.
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