Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let ages = Array.from(document.getElementsByTagName("tr")).filter(a => a.id.startsWith("id")).map(a => parseInt(a.childNodes[4].innerHTML));
- let avg_age = Math.round((ages.reduce((s, e) => s + e) / ages.length + Number.EPSILON) * 100) / 100;
- console.log(avg_age);
Add Comment
Please, Sign In to add comment