Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/playground #17

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added staff/eduardo-yeves/.gitkeep
Empty file.
Empty file.
63 changes: 63 additions & 0 deletions staff/eduardo-yeves/playground/array/Array.prototype.at.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
console.log('TEST Array.prototype.at')

console.log('CASE get videogames at index 4')

//var videogames = ['Age of Empires', 'Warcraft 3', 'Company of Heroes', 'V Rising', 'Warhammer 4,000: Darktide']
var videogames = new Array
videogames[0] = 'Age of Empires'
videogames[1] = 'Warcraft 3'
videogames[2] = 'Company of Heroes 3'
videogames[4] = 'V Rising'
videogames[5] = 'Warhammer 40,000: Darktide'
var videogame = videogames.at(4)
console.log(videogame)
//V Rising


console.log('CASE get book at index -2, -3, 1')

var shelf = new Array
shelf[0] = { name: 'La Rueda del Tiempo', author: 'Robert Jordan', genre: 'Fantasía' }
shelf[1] = { name: 'El Archivo de las Tormentas', author: 'Brandon Sanderson', genre: 'Fantasía' }
shelf[2] = { name: 'Proyecto Hail Mary', author: 'Andy Weir', genre: 'Ciencia Ficción' }
var book = shelf.at(-2)
console.log(book)
// { name: 'El Archivo de las Tormentas', author: 'Brandon Sanderson', genre: 'Fantasía' }
var book = shelf.at(-3)
console.log(book)
// { name: 'La Rueda del Tiempo', author: 'Robert Jordan', genre: 'Fantasía' }
var book = shelf.at(-1)
console.log(book)
// { name: 'Proyecto Hail Mary', author: 'Andy Weir', genre: 'Ciencia Ficción' }


console.log('CASE get book at index 10')
var shelf = new Array
shelf[0] = { name: 'La Rueda del Tiempo', author: 'Robert Jordan', genre: 'Fantasía' }
shelf[1] = { name: 'El Archivo de las Tormentas', author: 'Brandon Sanderson', genre: 'Fantasía' }
shelf[2] = { name: 'Proyecto Hail Mary', author: 'Andy Weir', genre: 'Ciencia Ficción' }
var book = shelf.at(10)
console.log(book)
// undefined

console.log('CASE get book at index -10')

var shelf = new Array
shelf[0] = { name: 'La Rueda del Tiempo', author: 'Robert Jordan', genre: 'Fantasía' }
shelf[1] = { name: 'El Archivo de las Tormentas', author: 'Brandon Sanderson', genre: 'Fantasía' }
shelf[2] = { name: 'Proyecto Hail Mary', author: 'Andy Weir', genre: 'Ciencia Ficción' }
var book = shelf.at(-10)
console.log(book)
// undefined


console.log('CASE get function at index 2')

var funs = new Array
funs[0] = function () { return 'A' }
funs[1] = function () { return 'B' }
funs[2] = function () { return 'C' }
funs[3] = function () { return 'D' }
var fun = funs.at(2)
console.log(fun())
// C
23 changes: 23 additions & 0 deletions staff/eduardo-yeves/playground/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
h1 {
color: purple;
background-color: lightblue;
font-size: 42px;
font-family: Arial, Helvetica, sans-serif;
font-weight: bolder;
border: 50px solid purple;
border-radius: 50px;
}

p {
color: red;
margin-left: 50px;
}

img {
border-radius: 25px;
border: solid bisque 100px;
}

h2 {
border: 1px solid black;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
function Dorraymon() {
this.length = 0
}

Dorraymon.prototype.at = function (index) {
if (index < 0) {
var newIndex = this.length + index
return this[newIndex]
} else {
return this[index]
}
}

console.log('TEST Dorraymon.prototype.at')

console.log(`CASE get videogame at index 4`)

//var cars = ['Age of Empires', 'Warcraft 3', 'Company of Heroes', 'V Rising', 'Warhammer 4,000: Darktide']
var videogames = new Dorraymon
videogames[0] = 'Age of Empires'
videogames[1] = 'Warcraft 3'
videogames[2] = 'Company of Heroes 3'
videogames[4] = 'V Rising'
videogames[5] = 'Warhammer 40,000: Darktide'
videogames.length = 6
var videogame = videogames.at(4)
console.log(videogame)
//V Rising


console.log('CASE get book at index -2, -3, -1')

var shelf = new Dorraymon
shelf[0] = { name: 'La Rueda del Tiempo', author: 'Robert Jordan', genre: 'Fantasía' }
shelf[1] = { name: 'El Archivo de las Tormentas', author: 'Brandon Sanderson', genre: 'Fantasía' }
shelf[2] = { name: 'Proyecto Hail Mary', author: 'Andy Weir', genre: 'Ciencia Ficción' }
shelf.length = 3
var book = shelf.at(-2)
console.log(book)
// { name: 'El Archivo de las Tormentas', author: 'Brandon Sanderson', genre: 'Fantasía' }
var book = shelf.at(-3)
console.log(book)
// { name: 'La Rueda del Tiempo', author: 'Robert Jordan', genre: 'Fantasía' }
var book = shelf.at(-1)
console.log(book)
// { name: 'Proyecto Hail Mary', author: 'Andy Weir', genre: 'Ciencia Ficción' }


console.log('CASE get book at index 10')

var shelf = new Dorraymon
shelf[0] = { name: 'La Rueda del Tiempo', author: 'Robert Jordan', genre: 'Fantasía' }
shelf[1] = { name: 'El Archivo de las Tormentas', author: 'Brandon Sanderson', genre: 'Fantasía' }
shelf[2] = { name: 'Proyecto Hail Mary', author: 'Andy Weir', genre: 'Ciencia Ficción' }
shelf.length = 3
var book = shelf.at(10)
console.log(book)
// undefined


console.log('CASE get book at index -10')

var shelf = new Dorraymon
shelf[0] = { name: 'La Rueda del Tiempo', author: 'Robert Jordan', genre: 'Fantasía' }
shelf[1] = { name: 'El Archivo de las Tormentas', author: 'Brandon Sanderson', genre: 'Fantasía' }
shelf[2] = { name: 'Proyecto Hail Mary', author: 'Andy Weir', genre: 'Ciencia Ficción' }
shelf.length = 3
var book = shelf.at(-10)
console.log(book)
// undefined


console.log('CASE get function at index 2')

var funs = new Dorraymon
funs[0] = function () { return 'A' }
funs[1] = function () { return 'B' }
funs[2] = function () { return 'C' }
funs[3] = function () { return 'D' }
funs.length = 4
var fun = funs.at(2)
console.log(fun())
// C
42 changes: 42 additions & 0 deletions staff/eduardo-yeves/playground/html/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML DOCUMENT</title>
<link rel="stylesheet" href="../css/style.css">
</head>

<body>
<h1>Esto es el encabezado principal,
<br>puede haber uno por página
</h1>

<h2>Segundo encabezado más importante</h2>
<h3>Tercer encabezado más importante</h3>
<h4>Cuarto encabezado más importante</h4>
<h5>Quinto encabezado más importante</h5>
<h6>Encabezado menos importante</h6>

<p>Esto es un párrafo de texto</p>

<!-- Asi se comenta en HTML -->

<!-- con <main> representamos el contenido principal del cuerpo de la página -->
<main>
<p>Este es el contenido principal, especificarlo ayuda con el SEO y la accesibilidad.
<br>Cómo es muy importante, le vamos a añadir un gif de un perrito usando el elemento "img"
<br>y añadiremos un texto alternativo con "alt" para ayudar con la accesibilidad
<br>o por si el gif no carga correctamente<br>

<img src="https://i.giphy.com/Fu3OjBQiCs3s0ZuLY3.webp"
alt="Un gif de un perro sonriente con flores en la cabeza">
</p>
</main>

<p>También podemos añadir un enlace a una página donde encontrar más gifs de perritos para nuestra web:</p>
<a href="https://giphy.com/search/dog">Gifs de perritos aquí</a>
</body>

</html>
14 changes: 14 additions & 0 deletions staff/eduardo-yeves/playground/js/console.log.challenge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var a = function b() {
return [{
}, [0, undefined, function c() {
return {
d: "not this",
e: ["not this", function f() {
return "THIS!!!"
}]
}
}
]]
}

console.log(a()[1][2]().e[1]())