Convert javascript examples to nodejs.

This commit is contained in:
Oliver Buchtala 2013-09-03 06:26:54 +02:00
commit 5da54ca435
48 changed files with 312 additions and 223 deletions

View file

@ -1,22 +1,22 @@
/* file: runme.js */
var example = require("./build/Release/example");
/* Call our gcd() function */
x = 42;
y = 105;
g = example.gcd(x,y);
print("GCD of x and y is=" + g);
console.log("GCD of x and y is=" + g);
/* Manipulate the Foo global variable */
/* Output its current value */
print("Global variable Foo=" + example.Foo);
console.log("Global variable Foo=" + example.Foo);
/* Change its value */
example.Foo = 3.1415926;
/* See if the change took effect */
print("Variable Foo changed to=" + example.Foo);
console.log("Variable Foo changed to=" + example.Foo);