Javascript examples.
This commit is contained in:
parent
ecf9f96079
commit
48af60d829
76 changed files with 1685 additions and 0 deletions
26
Examples/javascript/simple/runme.js
Executable file
26
Examples/javascript/simple/runme.js
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
var example = require("./build/Release/example");
|
||||
|
||||
/* Call our gcd() function */
|
||||
|
||||
x = 42;
|
||||
y = 105;
|
||||
g = example.gcd(x,y);
|
||||
console.log("GCD of x and y is=" + g);
|
||||
|
||||
/* Manipulate the Foo global variable */
|
||||
|
||||
/* Output its current value */
|
||||
console.log("Global variable Foo=" + example.Foo);
|
||||
|
||||
/* Change its value */
|
||||
example.Foo = 3.1415926;
|
||||
|
||||
/* See if the change took effect */
|
||||
console.log("Variable Foo changed to=" + example.Foo);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue