This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hello {}; | |
const hello = new Hello; | |
hello.constructor.name; | |
// -> "Hello" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typeof 1 | |
// -> "number" | |
typeof 0.001 | |
// -> "number" | |
0.001.constructor.name | |
// -> "Number" | |
isNaN(0.001) | |
// -> false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isNaN(1) | |
// -> false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.constructor.name | |
// -> Uncaught SyntaxError: Invalid or unexpected token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Hello".constructor.name | |
// -> "String" | |
(new Date).constructor.name | |
// -> "Date" | |
true.constructor.name | |
// -> "Boolean" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.isArray(['a', 'b']) | |
// -> true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.prototype.toString.call(['a', 'b']) === '[object Array]' | |
// -> true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typeof new Array('a', 'b') | |
// -> "object" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typeof ['a', 'b'] | |
// -> "object" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[wasm_bindgen(start)] | |
pub fn run() { | |
log(&format!("Hello, {}!", name())); | |
let x = MyClass::new(); | |
assert_eq!(x.number(), 42); | |
x.set_number(10); | |
log(&x.render()); | |
} |