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
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
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
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
// 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(); |
OlderNewer