In the following short script (running in my browser):
var ages = [23, 22, 4, 101, 14, 78, 90, 2, 1, 89, 19];
const ages3 = ages.map(function(age) {
return Math.sqrt(age) + "<br/>";
});
document.write(ages3);
I would like to print a column of square root values in the most concise manner possible (ideally using the map method above). I attempted to chain a join, e.g., return age.join(' ').Math.sqrt(age) + "<br/>"; but that was unsuccessful (no output was produced).
Thank you.