Running JavaScript code using the Node.JS interpreter
Posted: Fri Jan 15, 2016 11:05 am
PrimalScript 2015, v7.1.74, 64bit
Operating system: Windows 10-64bit
I am wondering whether it is possible to run standalone JavaScript codes in PrimalScript and output the result to the PrimalScript "Output" window. For example, I want to run the following code and I need to use the Node.js or any other interpreter except the Microsoft JScript runtime. How do I set this up so that the result of the script is displayed on the PrimalScript "Output" window?
Many thanks in advance.
Operating system: Windows 10-64bit
I am wondering whether it is possible to run standalone JavaScript codes in PrimalScript and output the result to the PrimalScript "Output" window. For example, I want to run the following code and I need to use the Node.js or any other interpreter except the Microsoft JScript runtime. How do I set this up so that the result of the script is displayed on the PrimalScript "Output" window?
Many thanks in advance.
- var player1={name:"Fred", score:"1000", rank:20};
- var player2={name:"Sam", score:"30000", rank:3};
- function playerDetails(){
- console.log(this.name + " has a rank of " + this.rank +
- " and a score of " +this.score)
- }
- player1.logDetails=playerDetails;
- player2.logDetails=playerDetails;
- player1.logDetails();
- player2.logDetails();