This file contains hidden or 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
//Terminals | |
var cuantos = ToTerm("cuantos"); | |
var cuantas = ToTerm("cuantas"); | |
var cual = ToTerm("cual"); | |
var que = ToTerm("que"); | |
var cuando = ToTerm("cuando"); | |
var tiene = ToTerm("tiene"); | |
/* más aquí */ | |
var number = new NumberLiteral("number"); | |
var number2 = new NumberLiteral("number2"); |
This file contains hidden or 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 o = { | |
a: 2, | |
m: function(b){ | |
return this.a + 1; | |
} | |
}; | |
console.log(o.m()); // 3 | |
// 'this' se refiere a 'o' cuya propiedad 'a' vale 2, | |
// así que m() regresa 3. |
This file contains hidden or 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 o = { | |
a: 2, | |
m: function(b){ | |
return this.a + 1; | |
} | |
}; |
This file contains hidden or 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
// Asumamos que tenemos un objeto o, con propiedades a y b: | |
// {a: 1, b: 2} | |
// o.[[Prototype]] tiene las propiedades b y c: | |
// {b: 3, c: 4} | |
// Finalmente, o.[[Prototype]].[[Prototype]] es null. | |
// Así que la cadena de prototipos queda como | |
// {a:1, b:2} ---> {b:3, c:4} ---> null | |
console.log(o.a); // 1 | |
// Existe una propiedad 'a' en o? Sí, y su valor es 1. |