From 9d7fd71f390528657c8d1731324a4d53a7d68198 Mon Sep 17 00:00:00 2001
From: Joolanda <50619917+Joolanda@users.noreply.github.com>
Date: Fri, 15 Nov 2019 15:18:54 +0100
Subject: [PATCH 1/9] reducing spec variables
---
js/scripts.js | 90 +++++++++++++++++----------------------------------
1 file changed, 29 insertions(+), 61 deletions(-)
diff --git a/js/scripts.js b/js/scripts.js
index fecec76..d29f93a 100644
--- a/js/scripts.js
+++ b/js/scripts.js
@@ -6,65 +6,33 @@
// This array will become the repository of Pokémon to display in myapplication
var repository = [
- pokemonName,
- pokemonHeight,
- pokemonType,
+ {
+ pokemonName: 'Absol',
+ pokemonHeight: "3'11\"",
+ pokemonType: 'dark',
+ };
+
+ {
+ pokemonName:'Luxray',
+ pokemonHeight: "4'07\"",
+ pokemonType: 'electric',
+ };
+
+ {
+ pokemonName:'Pikachu',
+ pokemonHeight: "1'04\"",
+ pokemonType: 'electric',
+ };
+
+ {
+ pokemonName: 'Milotic',
+ pokemonHeight: "20'04\"",
+ pokemonType: 'water',
+ };
+
+ {
+ pokemonName:'Eevee',
+ pokemonHeight: "1'00\"",
+ pokemonType: 'normal',
+ }
];
-
-// array of pokemon names
-var pokemonName = [
- 'Absol',
- 'Luxray',
- 'Pikachu',
- 'Milotic',
- 'Eevee',
-];
-
-// array of pokemon types, use array of strings
-var pokemonType = [
- 'water',
- 'electric',
- 'dark',
- 'normal'
-];
-
-// array of pokemon heights, use array of strings
-var pokemonHeight = [
- "3'11\"",
- "4'07\"",
- "1'04\"",
- "20'04\"",
- "1'00\"",
-];
-
-
-// defining the pokemons without external input
-var absol = {
- pokemonName: 'Absol',
- pokemonHeight: "3'11\"",
- pokemonType: 'dark',
-};
-
-var luxray = {
- pokemonName:'Luxray',
- pokemonHeight: "4'07\"",
- pokemonType: 'electric',
-};
-
-var pikachu = {
- pokemonName:'Pikachu',
- pokemonHeight: "1'04\"",
- pokemonType: 'electric',
-};
-
-var milotic = {
- pokemonName: 'Milotic',
- pokemonHeight: "20'04\"",
- pokemonType: 'water',
-};
-
-var eevee = {
- pokemonName:'Eevee',
- pokemonHeight: "1'00\"",
- pokemonType: 'normal',
-};
From 142bac01d987e4dc1db8b458543acb54d806805e Mon Sep 17 00:00:00 2001
From: Joolanda <50619917+Joolanda@users.noreply.github.com>
Date: Mon, 18 Nov 2019 09:07:16 +0100
Subject: [PATCH 2/9] Update scripts.js
---
js/scripts.js | 90 +++++++++++++++++++++++++++++++++------------------
1 file changed, 58 insertions(+), 32 deletions(-)
diff --git a/js/scripts.js b/js/scripts.js
index d29f93a..593dc0b 100644
--- a/js/scripts.js
+++ b/js/scripts.js
@@ -4,35 +4,61 @@
* Date: 2019-11-11
*/
- // This array will become the repository of Pokémon to display in myapplication
-var repository = [
- {
- pokemonName: 'Absol',
- pokemonHeight: "3'11\"",
- pokemonType: 'dark',
- };
-
- {
- pokemonName:'Luxray',
- pokemonHeight: "4'07\"",
- pokemonType: 'electric',
- };
-
- {
- pokemonName:'Pikachu',
- pokemonHeight: "1'04\"",
- pokemonType: 'electric',
- };
-
- {
- pokemonName: 'Milotic',
- pokemonHeight: "20'04\"",
- pokemonType: 'water',
- };
-
- {
- pokemonName:'Eevee',
- pokemonHeight: "1'00\"",
- pokemonType: 'normal',
- }
-];
+ // array of pokemon names
+ var pokemonName = [
+ 'Absol',
+ 'Luxray',
+ 'Pikachu',
+ 'Milotic',
+ 'Eevee',
+ ];
+
+ // array of pokemon types, use array of strings
+ var pokemonType = [
+ 'water',
+ 'electric',
+ 'dark',
+ 'normal'
+ ];
+
+ // array of pokemon heights, use array of strings
+ var pokemonHeight = [
+ "3'11\"",
+ "4'07\"",
+ "1'04\"",
+ "20'04\"",
+ "1'00\"",
+ ];
+
+ repository.push(pokemonName, pokemonType, pokemonHeight);
+
+ // defining the pokemons without external input
+ var absol = {
+ pokemonName: 'Absol',
+ pokemonHeight: "3'11\"",
+ pokemonType: 'dark',
+ };
+
+ var luxray = {
+ pokemonName:'Luxray',
+ pokemonHeight: "4'07\"",
+ pokemonType: 'electric',
+ };
+
+ var pikachu = {
+ pokemonName:'Pikachu',
+ pokemonHeight: "1'04\"",
+ pokemonType: 'electric',
+ };
+
+ var milotic = {
+ pokemonName: 'Milotic',
+ pokemonHeight: "20'04\"",
+ pokemonType: 'water',
+ };
+
+ var eevee = {
+ pokemonName:'Eevee',
+ pokemonHeight: "1'00\"",
+ pokemonType: 'normal',
+ };
From 1132157af6383ac9c4ac3c37f03ff7b97dcd65f5 Mon Sep 17 00:00:00 2001
From: Joolanda <50619917+Joolanda@users.noreply.github.com>
Date: Mon, 18 Nov 2019 09:23:02 +0100
Subject: [PATCH 3/9] adding for loop
---
js/scripts.js | 33 +++------------------------------
1 file changed, 3 insertions(+), 30 deletions(-)
diff --git a/js/scripts.js b/js/scripts.js
index 593dc0b..db8f53c 100644
--- a/js/scripts.js
+++ b/js/scripts.js
@@ -32,33 +32,6 @@
repository.push(pokemonName, pokemonType, pokemonHeight);
- // defining the pokemons without external input
- var absol = {
- pokemonName: 'Absol',
- pokemonHeight: "3'11\"",
- pokemonType: 'dark',
- };
-
- var luxray = {
- pokemonName:'Luxray',
- pokemonHeight: "4'07\"",
- pokemonType: 'electric',
- };
-
- var pikachu = {
- pokemonName:'Pikachu',
- pokemonHeight: "1'04\"",
- pokemonType: 'electric',
- };
-
- var milotic = {
- pokemonName: 'Milotic',
- pokemonHeight: "20'04\"",
- pokemonType: 'water',
- };
-
- var eevee = {
- pokemonName:'Eevee',
- pokemonHeight: "1'00\"",
- pokemonType: 'normal',
- };
+ for (var i = 0; i < pokemonName.length; i++) {
+ document.write(pokemonName[i]);
+ }
From ac852e6b15f04d2d343d61799bd91a1bfd8ecce1 Mon Sep 17 00:00:00 2001
From: Joolanda <50619917+Joolanda@users.noreply.github.com>
Date: Mon, 18 Nov 2019 10:11:10 +0100
Subject: [PATCH 4/9] including empty repository
---
index.html | 4 ++--
js/scripts.js | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/index.html b/index.html
index 3a63bbc..d1b6bc1 100644
--- a/index.html
+++ b/index.html
@@ -12,7 +12,7 @@
- Find me and other Pokémon's with this Pokédex List!
+ Find out more about me + other Pokémon's with this Pokédex List!
Hello! I am Píkachu.