best way to assign fetch response value to a variable [duplicate]

I searched entire stackoverflow for answer and almost all of them are either wrong or don’t work in a way I wanted (I mean actually assign to a variable).
Thanks to How to store fetch response in javascript variable I found the only real working solutions to question how to assign a fetch response to a variable.
But, Andrew provided two working answers:

import fetch from 'node-fetch'
------------------------------

async function fun() {
return fetch('https://api.exchangerate.host/2022-03-15?symbols=EUR&base=USD').then(res => res.json())
}
const data = await fun()
console.log(data)

//or

const fun = async () => {
const response = await fetch('https://api.exchangerate.host/2022-03-15?symbols=EUR&base=USD')
return response.json()
}
const data = await fun()
console.log(data)

So… which one is better? Which one should I use?