But doesn't it all trace back to C conventions anyways?
AS1 was plain ES3.
movieclip._x or movieclip._alpha (as in position and alpha blending) were accessed by properties with underscore to denote that you were using accessors (getters/setters).
Internally properties like Object.prototype.__proto__ had two underscores to denote they were private.
In AS2 you had:
class Foo extends Bar implements Xyz {
private foo
public function set x (value : Number) : void { ... }
public function get x () : Number { }
AS2 was based on long forgotten ES4 specification [0].
Under the hood it was still, what we would call today, transpiled to ES3 bytecode, as it run basically on the same VM as AS1.It's crazy to think it took us 10 years to reinvent the wheel with TypeScript.
AS3 was a complete rework, more akin to Java.
Programmers using underscore to denote identifiers for internal use was well-established and in use long before ActionScript even appeared. To claim that it's a "direct descendant" of ActionScript is arbitrary, anachronistic, and odd.
1. https://developers.google.com/apps-script/guides/html/commun...
So a variable that really ought to be named `class` you name `class_`.
A related conventional use of underscores in JS variable names is when "discarding" values in positional settings, like destructuring arrays.
E.g. `const [_, a, b] = triple`
In general, underscores in JS seem to be used to help call out what to ignore or what is less important.
But yeah for every other time most linters will accept _ as "ignore this".
Thanks for teaching me something today.