(function(n) { console.log(n * n) })(2) // 4, but instead of just printing if we want to return and store the data, we do as shown below let squaredNum = (function(n) { return n * n })(10) console.log(squaredNum)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter