When it comes to JavaScript code-golf, there tends to be two schools of thought regarding IO (specifically printing).
Some golfers will use functions such as alert
, document.write
, and console.log
(explicit printing), whereas other golfers will rely on the console implicitly logging the return value of statements executed in it (implicit printing).
I think it's worth discussing what the standard should be so that developers who make use of explicit printing are not at a disadvantage against developers using implicit printing. Of course, anyone posting a code golf could always explicitly override the standard.
Personally I believe that JavaScript code golf should work irrespective of where it's executed* (<script>
element, browser console, node, etc), which means that explicit printing would be required.
* some golfs will require exceptions to this due to the nature of the different environments