Avatar

gabby

1 public val
Joined January 27, 2023
1
2
3
4
5
6
7
8
import { fetchData } from "https://esm.town/v/gabby/fetchData";
export let getRandomPokemon = async () => {
const id = Math.floor(Math.random() * 151);
const url = `https://pokeapi.co/api/v2/pokemon/${id}`;
const data = await fetchData(url);
console.log(data.name);
};
Next