So let is just C-style variable scoping (except unlike in C, you don't get to declare a type), while var is... something weird

That's probably why everyone told me to just use let and don't touch var

@vaporeon_ it's even worse than you think! javascript has what is effectively a preprocessing phase where it looks for every single value initialized as a var and initializes them, and then the interpreter runs on the code like you would expect

this means you can use a variable before it is declared if you declare it with var! real javascript code out in the wild actually does this!!!!

Follow

@wallhackio @vaporeon_ yeah var is one of those early design decisions with surpurrisingly frustrating implications fur js implementations because it makes it impawsible to reliably parse in linear time—if you come across what may be an identifier, you do not know until later whether it is actually refurring to something or not

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.