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 Main { | |
| public static void main(String[] args) { | |
| Main.func("Hello world!"); | |
| } | |
| public static void func(String str) { | |
| String output = ""; | |
| for (int i = 0; i < str.length(); i++) { | |
| char character = str.charAt(i); | |
| if (output.indexOf(character) == -1){ |
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 (global) { | |
| class A { | |
| constructor() { | |
| console.log('soy clase A'); | |
| } | |
| } | |
| global.A = A; | |
| }(this)); |
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
| export class Animal { | |
| constructor(name) { | |
| this.name = name; | |
| } | |
| print() { | |
| console.log(`Soy animal del tipo ${this.name}`); | |
| } | |
| } | |
| export class Oso extends Animal { |
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
| // proxies es6 | |
| var empleado = { | |
| nombre: '', | |
| apellido: '', | |
| password: '32ioi4o24' | |
| }; | |
| // empleado.nombre = 'alejandro'; |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <div id="container"></div> | |
| </body> |
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 arr = ['a', 'b', 'c']; | |
| const iterador = arr[Symbol.iterator](); | |
| iterador.next(); | |
| // { value: 'a', done: false } | |
| iterador.next(); | |
| // { value: 'b', done: false } | |
| iterador.next(); | |
| // { value: undefined, done: true } | |
| /// Only for linear data strutures |
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() { | |
| var CSS_CLASS_DELIM, QuickdrawError, VirtualDomNode, dispatchEvent, exports, qd, qdInternal, | |
| slice = [].slice, | |
| indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, | |
| hasProp = {}.hasOwnProperty; | |
| qd = {}; | |
| if (typeof window !== "undefined" && window !== null) { | |
| if (window.qd != null) { |
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
| // Promesas (Promises) ES6 | |
| // XHR request XMLHttpRequest | |
| // cross domain request | |
| // https://www.mocky.io/ | |
| function request(url){ | |
| return new Promise((resolve, reject) => { | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open('GET', url); |
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 random(){ | |
| return Math.floor(Math.random() * 10); | |
| } | |
| function getJSON() { | |
| return new Promise(function (resolve, reject) { | |
| setTimeout(() => resolve('Yes'),random()); | |
| setTimeout(() => reject('No'), random()); | |
| }); | |
| } |
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
| /* jshint esnext: true */ | |
| // getters y setters | |
| var persona = { | |
| name: 'alejandro', | |
| lastname: 'amador', | |
| get fullname() { | |
| return `${this.name} ${this.lastname}` | |
| }, | |
| set fullname(fullvalue) { |