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
// 3. toReversed | |
const studentGrades = [90, 88, 98, 61, 78, 62, 64]; | |
// modifica el array original | |
studentGrades.reverse(); // [ 61, 62, 64, 78, 88, 90, 98 ] | |
const newStudentGrades = [90, 88, 98, 61, 78, 62, 64]; | |
// Immutabilidad! Devuelve un nuevo array sin modificar el original | |
newStudentGrades.toReversed(); |
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 { Suspense, lazy } from "react"; | |
import { ErrorBoundary, ErrorMessage } from "./Counter"; | |
import "./App.css"; | |
const Counter = lazy(() => import("./Counter")); | |
function App() { | |
return ( | |
<div className="App"> | |
<Suspense fallback={<p>Loading...</p>}> |
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 logo = document.getElementById("logo"); | |
let currentIndex = 0; | |
const keySequence = [ | |
"ArrowUp", | |
"ArrowUp", | |
"ArrowDown", | |
"ArrowDown", | |
"ArrowLeft", | |
"ArrowRight", | |
"ArrowLeft", |
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 data = [ | |
{ | |
title: "Aprendiendo JavaScript", | |
year: "2021", | |
isbn: "978-87001179623", | |
author: "Carlos Azaustre", | |
}, | |
{ | |
title: "Aprendiendo React", | |
year: "2023", |
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
// Database format: /products/{productId}/prices/{priceId} | |
export async function getProductPricesById(id) { | |
const prices = [] | |
const snapshot = await DataSource.collection('products') | |
.doc(id) | |
.collection('prices') | |
.get() | |
snapshot.forEach((doc) => { |
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
{ | |
"workbench.colorTheme": "Sorcerer", | |
"workbench.iconTheme": "material-icon-theme", | |
"editor.tabSize": 2, | |
"editor.cursorStyle": "block", | |
"window.zoomLevel": 0, | |
"[javascriptreact]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"[javascript]": { |
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
{ | |
"recommendations": [ | |
"2gua.rainbow-brackets", | |
"alexcvzz.vscode-sqlite", | |
"bashmish.es6-string-css", | |
"bierner.jsdoc-markdown-highlighting", | |
"bierner.markdown-preview-github-styles", | |
"blanu.vscode-styled-jsx", | |
"bradlc.vscode-tailwindcss", | |
"bungcip.better-toml", |
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 requestPromise = require('request-promise-native'); | |
const API = 'https://jsonplaceholder.typicode.com/posts/'; | |
function makeAPICall(id) { | |
return requestPromise({ | |
url: API + id, | |
method: 'GET', | |
json: 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 Empleado extends React.Component { | |
render () { | |
return ( | |
<li> | |
{this.props.nombre} - {this.props.email} | |
</li> | |
); | |
} | |
} |
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
var gulp = require('gulp'); | |
var webserver = require('gulp-webserver'); | |
var historyApi = require("connect-history-api-fallback"); | |
gulp.task('server', function(){ | |
gulp.src( path.root ) | |
.pipe(webserver({ | |
host : "0.0.0.0", | |
port : 8080, | |
livereload : true, |
NewerOlder