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
let arreglo = [1,2,3,4,5]; | |
let newArreglo = arreglo.filter((numero) => numero % 2 == 0 ); |
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
let firstObject = {}; | |
let secondObject = Object.create(firstObject); |
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
function modifcadorDeObjetos(objeto){ | |
let copiaDeObjeto = Object.assign({},objeto); | |
// Modificamos la copia para respetar el estado del objeto que recibimos | |
} |
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
let original = { | |
name: "Uriel", | |
type: "human" | |
}; | |
// Esta es una copia, con el atributo name modificado | |
let anotherHuman = Object.assign({},original,{ name: "Coco" }); |
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
class Human{ | |
constructor(name,lastName){ | |
this.name = name; | |
this.lastName = lastName; | |
//Asignamos el objeto actual como valor del contexto, y no cambiará | |
this.fullName = this.fullName.bind(this); | |
} | |
fullName(){ |
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
let object = {name: "Uriel" }; | |
Object.prototype.hasOwnProperty.call(object, "name"); // Retorna verdadero | |
Object.prototype.hasOwnProperty.call(object, "lastName"); // Retorna falso porque lastName no es una propiedad de object |
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
let human = { | |
name: 'Uriel', | |
lastName: 'Hernandez', | |
age: 24 | |
} | |
const {name,age} = human; | |
// La constante name es igual a 'Uriel' | |
// La constante age es igual a 24 |
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
package ace_builder | |
import( | |
"log" | |
"github.com/fsnotify/fsnotify" | |
"github.com/yosssi/ace" | |
"strings" | |
"bufio" | |
"os" | |
) |
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
const blue = "#f5f5f5"; | |
const label = "#2C3E50"; | |
const accentRed = "#ff5972"; | |
const green = "#468c56"; | |
const black = "#1f1f21"; | |
const lightBlue = "#6DBCDB"; | |
const roads = "#eadf8f"; | |
const transit = "#d3ba74"; | |
const styles = [ |
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
function debounce(func, wait, immediate) { | |
self.timeout = self.timeout || null; | |
return function() { | |
var context = this, args = arguments; | |
clearTimeout(self.timeout); | |
self.timeout = setTimeout(function() { | |
self.timeout = null; | |
if (!immediate) func.apply(context, args); | |
}, wait); | |
if (immediate && !self.timeout) func.apply(context, args); |