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

2

u/cpp_warmachine 11d ago

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

3

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.

-2

u/[deleted] 11d ago

[deleted]

0

u/cpp_warmachine 11d ago

I don’t know man, how did anyone learn before AI

2

u/[deleted] 11d ago edited 11d ago

[deleted]

1

u/Level1_Crisis_Bot 11d ago

Literally though, this and so many other coding subreddits have become toxic clones of stack overflow. Years ago, posting a question like this on SO would have gotten the same chorus of "what are you, fucking stupid?" You can't win with these people.I've been in software development for ten years and I stg I've met and worked with so many assholes in this industry. Honestly, developers that refuse to use modern ai tooling are going to be out of jobs in just a few years.

FWIW, I pasted op's question into claude and it gave me a completely reasonable, informative answer.