Binary digits: Difference between revisions

→‎JS ES5: Applied JS Beautify to adjust the spacing of an existing ES5 example
(→‎JS ES5: Applied JS Beautify to adjust the spacing of an existing ES5 example)
Line 1,453:
===ES5===
<lang javascript>function toBinary(number) {
return new Number(number).toString(2);
.toString(2);
}
var demoValues = [5, 50, 9000];
for (var i = 0; i < demoValues.length; ++i) {
print(toBinary(demoValues[i])); // alert() in a browser, wscript.echo in WSH, etc.
print(toBinary(demoValues[i]));
}</lang>
 
9,659

edits