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
Atom |
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
const contador = function(salto) { | |
let contador = 0; | |
return { | |
siguiente() { | |
contador += salto; | |
}, | |
ver() { | |
console.log(contador) | |
}, |
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
const humano = function(name) { | |
return { | |
nombre: name, | |
genero: '', | |
ciudad: 'Bogota', | |
decirGenero() { | |
console.log(this.nombre + ' mi genero es ' + this.genero ) | |
}, | |
decirCiudad() { | |
console.log(this.nombre + ' vivo en ' + this.ciudad) |
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
const comer = { | |
comer(comida = '') {console.log(`Estoy comiendo ${comida}`)} | |
} | |
const caminar = { | |
caminar() {console.log('estoy caminando')} | |
} | |
const taladrar = { | |
taladrar() {console.log('estoy taladrando')} |
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
const obj = { | |
get prop() { | |
return this.__prop__; | |
}, | |
set prop(value) { | |
this.__prop__ = value * 4; | |
}, | |
}; | |
var bb = { |
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
[10] < 9 // false, caso 1 | |
"a" < "b" // true, caso 2 | |
10 >= 10 // true, caso 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
21 === "21" // false, caso 1 | |
undefined === null // false, caso 1 | |
NaN === NaN // false, caso 4 | |
[10] == 10 // false, caso 1 | |
true == 1 // false, caso 1 | |
[] === [] //false, caso 8 | |
'10' === '10' //true, caso 7 |
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
null == undefined // true, caso 2.1 | |
10 == '10' // true, caso 2.2 | |
true == 1 // true, caso 2.3 | |
[10] == 10 // true, caso 2.4 | |
[] == [] // false, caso 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
// Constructor test | |
function constructor() { }; | |
function constructorTest(N) { | |
var start = Date.now(); | |
for (var i = 0; i < N; i++) { | |
new constructor(); | |
} | |
return (Date.now() - start) / N; |
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
// vincular `AuthController` con `LoginController` | |
const AuthController = Object.create( LoginController ); | |
AuthController.errors = []; | |
AuthController.checkAuth = function() { | |
let user = this.getUser(); | |
let pw = this.getPassword(); | |
if (this.validateEntry( user, pw )) { | |
this.server( "/check-auth",{ |