Ask coding questions

← Back to all posts
APIs - console.log()
EmilToubassi

Hello everyone,

I am learning about APIs.
In this repl, I am trying to make my console log JSON, but it is not working for some reason,
SyntaxError: Identifier 'url' has already been declared at /script.js:1:1

what could be the problem? (code in 'script.js')

thank you,
best,
Emil

Voters
EmilToubassi
Comments
hotnewtop
19ecal

It is because you have included your script twice in the HTML. Remove the first <script src="script.js"></script> and hopefully it should work

EmilToubassi

thank you! however I'm still facing a small issue, it works for now. but the console doesn't log what it's supposed to... I was expecting to see arrays, instead, it displays the whole contents in the console.. any advice? I'm still going through the code will update this if I manage to resolve it @19ecal

EmilToubassi

it works now!! thank you @19ecal

ch1ck3n

it's not repl.com it's repl.co

EmilToubassi

thanks for your reply. but the same issue is popping up.
if the url is already declared, where can i find it? @ch1ck3n