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
class ItemList{ | |
constructor(){ | |
this.item = []; | |
} | |
addItem(){ | |
this.item.push('Nuevo ítem'); | |
console.log(this.item); | |
} | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Doc</title> | |
</head> | |
<body> | |
<button id="nuevoitem">Añadir</button> | |
<script src="./bundle.js"></script> |
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
class ItemList{ | |
constructor(){ | |
this.item = []; | |
} | |
addItem(){ | |
this.item.push('Nuevo ítem'); | |
console.log(this.item); | |
} | |
} |
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
class List{ | |
constructor(){ | |
this.data = []; | |
} | |
add(data){ | |
this.data.push(data); | |
console.log(this.data); | |
} | |
} |
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
class Media{ | |
constructor(a, b, c, d){ | |
this.a = a; | |
this.b = b; | |
this.c = c; | |
this.d = d; | |
} | |
static Sumar(a, b, c, d){ | |
return ((a+b+c+d) / 4); |
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
module.exports = { | |
entry: './main.js', | |
output: { | |
path: __dirname, | |
filename: 'bundle.js', | |
}, | |
module:{ | |
rules:[ | |
{ | |
test: /\.js$/, |
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
import {sum} from './sum.js'; | |
console.log(sum(2,10)); |
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
export function sum(a, b){ | |
return a + b; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Doc</title> | |
</head> | |
<body> | |
<script src="./bundle.js"></script> | |
</body> |
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
import axios from 'axios'; | |
class Api{ | |
static async getUserInfo(username){ | |
try{ | |
const response = await axios.get('https://api.github.com/users/'+username); | |
console.log(response); | |
} catch (err){ | |
console.warn('Error'); | |
} |