Alex Crichton d8e5930799 Add an example of console.log
Also clean up some other exampels
2018-03-09 10:25:48 -08:00

19 lines
261 B
Rust

#![feature(proc_macro)]
extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern {
type console;
#[wasm_bindgen(static = console)]
fn log(s: &str);
}
#[wasm_bindgen]
pub fn run() {
console::log("Hello from Rust!");
}