wasm-bindgen/examples/math/index.js

11 lines
317 B
JavaScript
Raw Normal View History

2018-03-21 20:03:40 +03:00
// For more comments about what's going on here, check out the `hello_world`
// example
const rust = import('./math');
2018-03-21 20:03:40 +03:00
rust.then(m => {
m.run();
console.log('and in JS the answers look like:');
console.log(`Math.log2(10.0) = ${Math.log2(10.0)}`);
console.log(`Math.sin(1.2) = ${Math.sin(1.2)}`);
2018-03-21 20:03:40 +03:00
});