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
/** | |
* Simulacion de asincronia en JavaScript (Funcion A). | |
* | |
* @param Array list Lista de numeros. | |
* @param Function callback Recibe la funcion B. | |
*/ | |
const asincronia = (list, callback) => { | |
//se valida que el parametro list sea un arreglo | |
//y no este vacio | |
if (list instanceof Array && list.length > 0) { |
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
/** | |
* Referencia al objeto XMLHttpRequest. | |
*/ | |
var XHTTP = new XMLHttpRequest(); | |
/** | |
* Petmite indcar si la peticion ya se ejecuto. | |
*/ | |
const DONE = 4; | |
/** | |
* Status que retorna el servidor |
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
/** | |
* Simulacion de asincronia en JavaScript (Funcion A). | |
* | |
* @param Array list Lista de numeros. | |
*/ | |
const asincronia = (list) => { | |
//declaracion de la promesa. | |
let promise = new Promise( (resolve, reject) => { | |
//se valida que el parametro list sea un arreglo | |
//y no este vacio |
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
/** | |
* Referencia al objeto XMLHttpRequest. | |
* | |
* @type XMLHttpRequest. | |
*/ | |
var XHTTP = new XMLHttpRequest(); | |
/** | |
* Petmite indcar si la peticion ya se ejecuto. | |
* | |
* @type Integer. |
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
/** | |
* permite la declaracion del regenrator runtime, lo cual nos permite | |
* utilizar las librerias necesarias utilizar async/await. | |
*/ | |
require("babel-polyfill"); | |
/** | |
* Ruta para la api de pokemons. | |
* | |
* @type String. | |
*/ |
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
/** | |
* Permite la utilizacion de las nuevas caracteristicas de EcmaScripts. | |
* | |
* @type babelify. | |
*/ | |
const BABELIFY = require("babelify"); | |
/** | |
* Nos permitira generar el empaquetado de nuestro codigo esto incluira | |
* las librerias que estemos utilizando. | |
* |
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
/** | |
* Declaracion de nuestro prototipo | |
* Esto tambien funcionara como un constructor | |
*/ | |
function CalculadoraUsandoPrototype() | |
{ | |
//Variables que estaran disponibles en el scope global | |
//del prototipo | |
this.valor_a = 0; | |
this.valor_b = 0; |
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
/** | |
* Declaracion de la clase. | |
*/ | |
class CalculadoraUsandoClass | |
{ | |
/** | |
* Metodo principal para incializar nuestra clase. | |
* | |
* @return void. | |
*/ |
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
/** | |
* Declaramos la clase suma de la cual | |
* extendera la CalculadoraUsandoClass. | |
*/ | |
class SumaUsandoClass | |
{ | |
/** | |
* Metodo principal para incializar nuestra clase. | |
* | |
* @return void. |
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
/** | |
* Declaracion de nuestro prototipo | |
* Esto tambien funcionara como un constructor | |
*/ | |
function SumaUsandoPrototype() | |
{ | |
console.log("Soy el consturctor de la clase SumaUsandoClass"); | |
}//SumaUsandoPrototype | |
//=================================================// |
OlderNewer