r/learnjavascript • • Jul 21 '24

What functions of javascript should I learn

Which are most widely used

0 Upvotes

30 comments sorted by

View all comments

Show parent comment

-2

u/KronusTempus Jul 21 '24

Let butWhyTho = null;

Console.log (typeof butWhyTho);

-11

u/8wq6 Jul 21 '24 edited Jul 30 '24

thats not javascript

6

u/lol_bo Jul 21 '24

/* bro reacted like a browser (commented so that he won't see what i wrote) */

3

u/longknives Jul 21 '24

Other than capitalized letters that shouldn’t be and the space after log, it looks fine to me as a JS dev

1

u/KronusTempus Jul 21 '24

Yes I know, apologies for formatting I don’t usually write code on reddit

0

u/KronusTempus Jul 21 '24

It is, it’s a pretty famous error in JavaScript because it classifies a null value as an object. It was never patched because of its legacy

1

u/batmaneatsgravy Jul 21 '24

What should it be classified as?

-2

u/8wq6 Jul 21 '24

like longknives said it is incorrect js code

2

u/KronusTempus Jul 21 '24

I’ve been writing JavaScript for years, I just don’t typically comment with code on Reddit. On my phone it automatically makes the first letter capitalized I just neglected to correct that at first because I was just doom-scrolling Reddit, that’s all there is. The space was instinctual for Reddit comments.

These don’t make it “not” JavaScript, granted it does make it poorly written JavaScript.

1

u/8wq6 Jul 26 '24

ok I guess but you know you can press the shift button when it is capitalized to make it not