Home
Tools
Blog
☀ Light
⌕
Search tools
⌘K
Tools
/
JS Runner
▶
JS Runner
New
Run Code
Load Sample
Clear
JavaScript
231 chars
const values = [1, 2, 3, 4] const squared = values.map((num) => num * num) console.log('Squared:', squared) const total = squared.reduce((sum, num) => sum + num, 0) console.info('Total:', total) ({ total, count: squared.length })
Console Output
Run your script to see output
Return Value
Returned value appears here...