Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
<!DOCTYPE html><html><body style="padding:20px;font-family:Arial"><div id="o"></div><script>const n=[1,2,3,4,5];document.getElementById("o").innerHTML="<p>doubled: ["+n.map(x=>x*2)+"]</p><p>evens: ["+n.filter(x=>x%2===0)+"]</p><p>sum: "+n.reduce((a,x)=>a+x,0)+"</p>";</script></body></html>
Result
Open