r/JavaScriptTips • • Mar 14 '23

What am I doing wrong?

Post image
6 Upvotes

7 comments sorted by

2

u/Affectionate_Tree790 Mar 14 '23

Just decided to learn coding so I can do a website. The videos I’m watching gave me the challenge to reassign a value.

The video has said to use the console of the developer tools on Google.com but it just doesn’t seem to work how it was explained.

I’ve clicked the learn more but it’s not that helpful.

P.s. it’s not the first time the developer tools have let me down. I can see in video that their code works, so I’m left thinking that the dev tools have been changed on certain websites which is what’s causing most issues. But I don’t know about this, probably me being new.

1

u/No-Equivalent-9489 Mar 14 '23

Others have already answered your problem so I won't go into that. But I think you have some misunderstanding about dev tools "I’m left thinking that the dev tools have been changed on certain websites which is what’s causing most issues" Dev tools are provided by the browsers and are not dependent on what website you have opened on the browser. Dev tools may differ across different browsers and different versions of browsers. But in a browser it works the same for any website.

1

u/Affectionate_Tree790 Mar 15 '23

I had an encounter where I was unable to alter any images on the Google.com homepage. But could anywhere else using the same code. The video I was watching was able to change it on the homepage but I wasn’t. The only difference was I was logged into an account where as the video wasn’t.

Just had small things like that occur.

2

u/Ironclad_57 Mar 14 '23

Don’t include the declaration keyword (var let) when you change a variable only on first declaration. So Var i = 0; i = 1;

Not Var i = 0; Var i = 1;

1

u/20_chickenNuggets Mar 15 '23

Just a tip: whenever you encounter an error message then copy it and google it. This will give you so much more information than posting it on Reddit

-2

u/[deleted] Mar 14 '23

Not using a MacBook.

0

u/[deleted] Mar 14 '23

[deleted]

2

u/Affectionate_Tree790 Mar 14 '23

Thank you. I see the error and it’s oversight on my end.

I will state though I’m only two days into trying to teach myself as it is stated in my above message. So please excuse me if the question seems stupid but at this point in time I am stupid in JavaScript.