Skip to content

Instantly share code, notes, and snippets.

View yeion7's full-sized avatar
🍉

Yeison Daza yeion7

🍉
View GitHub Profile
Atom
const contador = function(salto) {
let contador = 0;
return {
siguiente() {
contador += salto;
},
ver() {
console.log(contador)
},
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)
const comer = {
comer(comida = '') {console.log(`Estoy comiendo ${comida}`)}
}
const caminar = {
caminar() {console.log('estoy caminando')}
}
const taladrar = {
taladrar() {console.log('estoy taladrando')}
const obj = {
get prop() {
return this.__prop__;
},
set prop(value) {
this.__prop__ = value * 4;
},
};
var bb = {
[10] < 9 // false, caso 1
"a" < "b" // true, caso 2
10 >= 10 // true, caso 3
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
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
// 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;
// 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",{