So I have used .then
to try and assign the value of promise to the object but I can't and now I tried a anonymous async function which isnt helping me.
import fetch from 'node-fetch'
import { setProps } from '../helpers/objectResponse.js';
if (!globalThis.fetch) {
globalThis.fetch = fetch;
}
const wrapMe = (pokimon) => {
let value;
const getPokimon = async (pokimon) => {
const data = await fetch(`https://pokeapi.co/api/v2/pokemon/${pokimon.toLowerCase()}`);
const response = await data.json();
return response
}
(async () => {
const data = await getPokimon(pokimon);
return value = data
})
return value
}```