Running JavaScript from the windows command prompt
问题 I wrote the following JavaScipt code which converts a binary number into a decimal number: (function bin_dec(num) { var x = num; var result = 0; for (var i = 0; i < x.length; i++) { result += eval(x[x.length - i] * 2^i); } return result; })() I want to be able to run this code from the command-line. The filename is converter.js and I am running the command prompt window in the same directory as the file. I am trying to run this code using 01001100 as the function argument. Here are my