Skip to content

Commit dcff9b2

Browse files
committed
Prototypes
1 parent 846d161 commit dcff9b2

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,3 +349,26 @@ Mas información
349349
>Para saber mas [DOMContentLoaded](<https://developer.mozilla.org/es/docs/Web/Events/DOMContentLoaded>)
350350
>>En JQUERY vendria siendo como el `$( document ).ready()`
351351
---
352+
353+
---
354+
355+
# Prototypes
356+
357+
Prototypes son propiedades de un elemento de JavaScript dependiendo del tipo que sean, estas estan predefinidas ó pueden ser creadas por el usuario.
358+
359+
Mas información
360+
[Prototypes](https://developer.mozilla.org/es/docs/Web/JavaScript/Referencia/Objetos_globales/Function/prototype)
361+
362+
>En la CONSOLA del Navegador de tu preferencia puedes ver los `prototypes` que tiene asignado el elemento que estes revisando, ya que como te menciono ya llevan predefinidos.
363+
364+
```js
365+
//Declaramos un arreglo vacio
366+
const arreglo = [];
367+
//Imprimos el arreglo
368+
console.log(arreglo);
369+
// Desglozamos el elemento utilizando la flecha y veremos todas sus propiedades tales como sus metodos que puede utilizar siendo un ´Array´.
370+
```
371+
372+
![Prototype](prototypes/prototype.png)
373+
374+
>Pero como indicamos podemos crear nuevos metodos, como se muestra a continuación.

prototypes/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
11+
<script src="js.js"></script>
12+
</body>
13+
</html>

prototypes/js.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const arreglo = [];
2+
3+
console.log(arreglo);

prototypes/prototype.png

34.4 KB
Loading

0 commit comments

Comments
 (0)