What is JavaShit?
JavaShit was a dialect of JavaScript primarily used by C#, Java and some Python developers between early 2000s and late 2010s. It was immensely popular (though not loved) among web developers, overshadowing JavaScript itself. Due to its popularity, it is commonly referred to as JavaScript, but they are technically different languages.
JavaShit is a subset of JavaScript which limits the developers to exotic
features not normally used in JavaScript. A common example of JavaShit features
includes the use arithmetic operators between values of different types. For
example, while 2 + "2" is allowed, 2 + 2 is not allowed. In other words,
it only allows you to do things that JavaScript programmers tend to avoid.
JavaShit is executed on any platform where JavaScript can run.
Writing programs using JavaShit was quite difficult, with one of the most common complaints being that JavaScript engines will not complain when a JavaShit developers attempts to write an invalid JavaScript program. This was seen as a sign that JavaScript itself is an 'inferior' language, despite the fact that the programmers were coding in JavaShit.
Since it was very difficult to write meaningful programs using JavaShit, it was phased out along with the raise in the popularity of TypeScript in the late 2010s. TypeScript is a language designed to help JavaShit programmers write JavaScript, and its key feature is the type checker that emits warnings upon detecting idiomatic JavaShit code. Because JavaShit examples look very similar to JavaScript, and due to the abundance of JavaShit examples mislabelled as JavaScript, many beginners, particularly those with years of experience using other languages, tend to confuse JavaShit with JavaScript, even though the former has been mostly dead since early 2020s. This lead to a huge popularity of the idea that TypeScript is a superior version of JavaScript. Veteran JavaScript developers mostly yawned at the idea, but this was dismissed as a statistical error.
Today, JavaShit is mostly learned as an early introduction to TypeScript, presumably because the full advantage of the latter cannot be taken without knowing JavaShit. Novice developers also sometimes pick up JavaShit by mistake while tyring to learn JavaScript. There is anecdotal evidence that AI tools such as ChatGPT or Copilot will emit JavaShit when instructed to use JavaScript.
Every syntactically valid JavaShit code is also syntactically valid JavaScript. However, a valid JavaShit program is usually an invalid JavaScript program. This lead to the popularity of SOS (same-origin scripting) attacks, where the attacker deploys JavaShit on the same domain as the site and compromises the client's privacy, security, sanity, and sometimes even life.