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
// String.prototype.padStart() | |
'abc'.padStart(10); // " abc" | |
'abc'.padStart(10, "foo"); // "foofoofabc" | |
'abc'.padStart(6,"123465"); // "123abc" | |
'abc'.padStart(8, "0"); // "00000abc" | |
'abc'.padStart(1); // "abc" | |
// String.prototype.padEnd() | |
'abc'.padEnd(10); // "abc " | |
'abc'.padEnd(10, "foo"); // "abcfoofoof" |
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
// Todo lo que ves es JavaScript válido 🎉🎉🎉 | |
const arr = [ | |
1, | |
2, | |
3, | |
]; | |
const hero = { | |
lastname: 'Izuku', |
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
const quirks = { | |
midoriya: 'One For All', | |
uraraka: 'Zero Gravity', | |
bakugo: 'Explosion' | |
}; | |
console.log(Object.values(quirks)); | |
// > ['One For All', 'Zero Gravity', 'Explosion'] |
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
const quirks = { | |
midoriya: 'One For All', | |
uraraka: 'Zero Gravity', | |
bakugo: 'Explosion' | |
}; | |
console.log(Object.entries(quirks)); | |
// > [['midoriya', 'One For All'], ['uraraka', 'Zero Gravity'], ['bakugo', 'Explosion']] | |
console.log(Object.entries(quirks).map(([hero, quirk]) => `Hero: ${hero}, Quirk: ${quirk}`)); |
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
# editorconfig.org | |
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
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 Emitter { | |
constructor() { } | |
} | |
module.exports = Emitter |
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
[ | |
{ | |
"id": "1878968952505694822_3448238252", | |
"user": { | |
"id": "3448238252", | |
"full_name": "Schr\u00f6dinger", | |
"profile_picture": "https://scontent.cdninstagram.com/vp/56a5709e23f37eb1aa98b609fb3ddb88/5C5178DB/t51.2885-19/s150x150/27574414_2017402211856772_2506581521406623744_n.jpg", | |
"username": "theschrodingercat" | |
}, | |
"images": { |
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
// Place your settings in this file to overwrite the default settings | |
{ | |
"editor.fontFamily": "Operator Mono", | |
"editor.fontLigatures": true, | |
"editor.fontSize": 14, | |
"editor.formatOnSave": true, | |
"editor.minimap.enabled": true, | |
"git.confirmSync": false, | |
"git.enableSmartCommit": true, | |
"typescript.check.npmIsInstalled": false, |
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
const dc = [ | |
{ name: "batman", power: 100 }, | |
{ name: "superman", power: 90 }, | |
{ name: "greenarrow", power: 70 }, | |
{ name: "greenlantern", power: 70 } | |
] |
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
// underscore | |
_.each(dc, x => console.log(x.name)) | |
// nativo | |
dc.forEach(x => console.log(x.name)) | |
// output | |
// > batman | |
// > superman | |
// > greenarrow | |
// > greenlantern |