Skip to content

Commit 8965b8d

Browse files
committed
update, reviewing module 2 languages
1 parent 6e1c5b4 commit 8965b8d

6 files changed

Lines changed: 13 additions & 9 deletions

File tree

40 Bytes
Binary file not shown.

02-languages/02-apuntes/01-javascript/108 classes.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ console.log(juan.isMinimumSalary); // undefined
125125

126126
// *** PROPIEDADES PRIVADAS
127127

128-
// Sólo pueden ser accedidas desde métodos creados dentro del cuerpo de una clase
128+
// Sólo pueden ser accedidas desde métodos creados dentro del cuerpo de una clase.
129+
// La notación con el modificador # está disponible a partir de ES2022.
129130

130131
class Person {
131132
// ⚠ Deben ser declaradas dentro de la clase
@@ -144,7 +145,7 @@ antonio.greet();
144145
console.log(antonio.name); // undefined
145146
console.log(antonio.#name); // Error!
146147

147-
// Refactorización del mismo ejemplo Employee con propiedades privadas
148+
// Refactorización del mismo ejemplo Employee con propiedades privadas.
148149

149150
class Employee {
150151
// Ahora este valor no es accesible de forma externa
@@ -178,6 +179,8 @@ console.log(antonio.getDetails());
178179

179180
// Podemos inicializar propiedades que parten de valores fijos sin usar constructor. Si te fijas
180181
// las hemos visto anteriormente pero con otros modificadores: `static` y el prefijo de privado `#`.
182+
// Esta notación de class fields está disponible a partir de ES2022.
183+
181184
// También podemos crear propiedades públicas de este modo:
182185

183186
class Counter {

02-languages/02-apuntes/02-typescript/107 utility types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ type UserCommon = Common<UserDetails, UserID>; // Check intellisense!
176176
const calculateCommon = <A extends object, B extends object>(a: A, b: B): Common<A, B> => {
177177
const result = { ...a };
178178
for (const key in a) {
179-
if (a.hasOwnProperty(key) && !b.hasOwnProperty(key)) delete result[key];
179+
// A partir de ES2022 podemos usar Object.hasOwn como reemplazo de Object.prototype.hasOwnProperty
180+
if (Object.hasOwn(a, key) && !Object.hasOwn(b, key)) delete result[key];
180181
}
181182
return result;
182183
};

02-languages/04-playgrounds/01-playground-javascript/src/index.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ html, body {
2222
}
2323

2424
.title {
25-
font-size: 5em;
25+
font-size: min(max(calc(2rem + 48 * ((100vw - 360px) / 280)), 2rem), 5rem);
2626
font-weight: bolder;
2727
color: rgba(255, 255, 255, 0.7);
2828
margin: 1rem 0 1rem;
2929
}
3030

3131
.caption {
32-
font-size: 1.75rem;
32+
font-size: min(max(calc(1.25rem + 16 * ((100vw - 360px) / 280)), 1.25rem), 2.25rem);
3333
color: rgba(255, 255, 255, 0.7);
3434
margin: 1rem 0 1rem;
3535
}

02-languages/04-playgrounds/02-playground-typescript/src/index.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ html, body {
2222
}
2323

2424
.title {
25-
font-size: 5em;
25+
font-size: min(max(calc(2rem + 48 * ((100vw - 360px) / 280)), 2rem), 5rem);
2626
font-weight: bolder;
2727
color: rgba(255, 255, 255, 0.7);
2828
margin: 1rem 0 1rem;
2929
}
3030

3131
.caption {
32-
font-size: 1.75rem;
32+
font-size: min(max(calc(1.25rem + 16 * ((100vw - 360px) / 280)), 1.25rem), 2.25rem);
3333
color: rgba(255, 255, 255, 0.7);
3434
margin: 1rem 0 1rem;
3535
}

02-languages/04-playgrounds/03-playground-ejercicios/src/index.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ html, body {
2222
}
2323

2424
.title {
25-
font-size: 5em;
25+
font-size: min(max(calc(2rem + 48 * ((100vw - 360px) / 280)), 2rem), 5rem);
2626
font-weight: bolder;
2727
color: rgba(255, 255, 255, 0.7);
2828
margin: 1rem 0 1rem;
2929
}
3030

3131
.caption {
32-
font-size: 1.75rem;
32+
font-size: min(max(calc(1.25rem + 16 * ((100vw - 360px) / 280)), 1.25rem), 2.25rem);
3333
color: rgba(255, 255, 255, 0.7);
3434
margin: 1rem 0 1rem;
3535
}

0 commit comments

Comments
 (0)