mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-04-18 03:00:27 -04:00
Add .call example
This commit is contained in:
@@ -128,3 +128,15 @@ function eg7() {
|
||||
|
||||
console.log(f); // 3
|
||||
}
|
||||
|
||||
function eg8() {
|
||||
let x = {};
|
||||
|
||||
function addFoo() {
|
||||
this.foo = 'bar';
|
||||
}
|
||||
|
||||
addFoo.call(x);
|
||||
|
||||
console.log(x.foo); // 'bar'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user