Last active
July 20, 2020 20:22
-
-
Save faloi/521dfc644e07f68f8618ba2810760132 to your computer and use it in GitHub Desktop.
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
Wollok JavaScript | |
====== ========== | |
// Booleanos | |
and && | |
or || | |
not ! | |
// Listas (no hay conjuntos en JS de forma nativa) | |
add(algo) push(algo) | |
size() length | |
forEach { x => } forEach(x => ) | |
filter { x => } filter(x => ) | |
map { x => } map(x => ) | |
all { x => } every(x => ) | |
any { x => } some(x => ) | |
// Clases | |
class GolondrinaWollok { | |
var energia = 0 | |
method volar(kms) { | |
energia -= kms * 2 | |
} | |
method energia() { | |
return energia | |
} | |
} | |
class GolondrinaJS { | |
constructor() { | |
this._energia = 0 | |
} | |
volar(kms) { | |
this._energia -= kms * 2 | |
} | |
energia() { | |
return this._energia | |
} | |
} |
¿Y con el this
qué hacemos? ¿Y los atributos? Me parece que no hay una buena equivalencia entre objetos Wollok y objetos JS.
¿Y con el
this
qué hacemos? ¿Y los atributos? Me parece que no hay una buena equivalencia entre objetos Wollok y objetos JS.
Eso ya no funciona bien en JS? :P
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Se podría agregar: