Yes, and historically those code demos were often wrong in many important ways (like not working in all browsers, or insecure). They are much better now but reputation is hard to recover.
That must have been like 12 years ago or more at least because in my career I don't have much memory of feeling betrayed by the information on their site.
It's exactly 12 years ago. I started learning JavaScript in summer 2011 and I remember w3school was often misleading.
Yes some people have been doing web development for more than 12 years (:
Wouldn't that have been the case everywhere before JS browser support standardized to ES 2015 and above?
It's a question of presentation. Back then (and to be clear, I'm talking about 00s here) the correct way was to point out that something might not even be doable in cross-browser way at all, and listing the proprietary features that'd let you do it in specific browsers while clearly labeling them as proprietary. Quality websites would do that, while w3schools and the likes would just give you the snippet for (usually) IE. Worse yet, in many cases they would keep suggesting the old proprietary approach even after a new standardized way of implementing something showed up.