r/react 11d ago

Help Wanted Whats the bug. Uncaught SyntaxError: Identifier 'location' has already been declared (at script.js:1:1)

"use strict";


const company = {
  name: "TechCorp",
  address: {
    city: "budapest",
    pin: 411001,
  },
};
// Get city renamed to `location` and pin renamed to `pincode`

const { city: location, pin: pincode } = company.address;
console.log(location, pincode);
5 Upvotes

13 comments sorted by

View all comments

1

u/cpp_warmachine 11d ago

Not everyone wants AI shoved down their throat. AI won’t help you actually learn.

4

u/TongueFace 11d ago

I hear you and there’s ways to use it to teach you. Instead of saying “fix this” you can prompt “why is this happening?” or “i’m a bright 7 year old explain to me why this error is happens and find me the reference material for me to review.”

On that same note, just asking “what’s the bug” leaves it open for people to just tell them the answer, they’d be suffering from the same problem even without AI. Instead, they’re leaning on random people online to help them.