JS fetch... how to return arguement value so we can reuse the function easily..? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 3

JS fetch... how to return arguement value so we can reuse the function easily..?

I was trying to make a YouTube live subscribers counter. I did it for one user, but then I wanted to do it for multiple users at the same time. But Iā€™ve been scratching my head 7283 times and canā€™t figure it out. Normally it would be something like this: x.innerHTML = getSubsCount(Me, something) y.innerHTML = getSubsCount(You, something) But with this fetch Ali thing... I donā€™t know how to work around it. A little example on what Iā€™m talking about https://code.sololearn.com/WapXhxCK1w2D/?ref=app https://code.sololearn.com/W5W5t8xGKJS7/?ref=app

23rd Oct 2020, 6:55 AM
Ginfio
Ginfio - avatar
1 Resposta
+ 1
It's not possible. You can find some alternatives here https://www.sololearn.com/discuss/2552332/?ref=app
23rd Oct 2020, 10:16 AM
Kevin ā˜