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
// https://github.com/tldraw/tldraw-yjs-example | |
import { | |
InstancePresenceRecordType, | |
TLAnyShapeUtilConstructor, | |
TLInstancePresence, | |
TLRecord, | |
TLStoreWithStatus, | |
computed, | |
createPresenceStateDerivation, | |
createTLStore, |
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
var foo = () => arguments[0]; | |
foo(); // arguments is not defined | |
function bar() { | |
return arguments[0]; | |
} | |
bar(); // undefined |
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
let arr = (...params) => console.log(params); | |
arr(1, 2, 3) | |
// [1, 2, 3] |
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
let foobar = (param1, param2 = "param2") => { | |
console.log(param1); | |
console.log(param2); | |
} | |
foobar(1); | |
// 1 | |
// param2 |
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
var FooBar = () => {}; | |
console.log(FooBar.prototype); | |
// undefined |
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
let Clock = () => { | |
this.sec = 0; | |
setInterval(() => { | |
this.sec ++; | |
}, 1000) | |
} | |
var newClock = new Clock(); |
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
"use strict"; | |
function Clock() { | |
var _this = this; | |
this.sec = 0; | |
setInterval(function () { | |
_this.sec++; | |
}, 1000); | |
} |
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
function Clock(){ | |
this.sec = 0; | |
setInterval(() => { | |
this.sec ++; | |
}, 1000) | |
} | |
var newClock = new Clock(); |