This commit is contained in:
Philippe Torrel
2026-07-08 11:55:05 +02:00
parent cc3dc382ed
commit 199d580016
247 changed files with 38615 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="de">
<head>
<meta charset="UTF-8" />
@@ -41,13 +41,30 @@
['Dratini', 'Dragonair', 'Dragonite'],
];
const stagesFor = (pokemon) => {};
const stagesFor = (pokemon) => {
const stages = evolutionStages.find((stages) => stages.includes(pokemon));
const stagesAfter = (pokemon) => {};
if (!stages) {
console.warn('stages not found');
return [];
}
const stagesBefore = (pokemon) => {};
return stages; // wenn unfedined leeres array zurückgeben
};
const stagesAfter = (pokemon) => {
const stages = stagesFor(pokemon);
return stages.slice(stages.indexOf(pokemon) + 1);
};
const stagesBefore = (pokemon) => {
const stages = stagesFor(pokemon);
return stages.slice(0, stages.indexOf(pokemon));
};
console.log(stagesFor('Vulpix')); // => [ 'Vulpix', 'Ninetales' ]
console.log(stagesAfter('Anton')); // =>
console.log(stagesAfter('Dratini')); // => [ 'Dragonair', 'Dragonite' ]
console.log(stagesBefore('Pidgeot')); // => [ 'Pidgey', 'Pidgeotto' ]
console.log(stagesBefore('Dragonair')); // => [ 'Dratini' ]