Selenium is in general painfully slow, cumbersome, error prone, difficult to setup correctly and automate.
The lambdatest articles have been receiving more upvotes than typical and while not inherently bad, I'm just suspicious of the upvote activity.
Playwright is also worth a look. It's similar to puppeteer, and a few of the main developers were hired by MS (also puppeteer devs) to work on playwright.
https://github.com/microsoft/playwright
Interesting... a made a couple issues around supporting etags and if-modified-since requests as well as pre-compressed static content.
Should probably prefer streaming file responses for static instead of reading the file entirely and returning it from in-memory.
Considering every modern browser supports async functions, would definitely use that syntax over the death tree of thenables for the code samples... the logic is difficult to follow.
Also, posting a more complete set of examples in a github or gist would be beneficial.
Generally not a fan of the N best of JS articles (will usually delete them), as there's no mention of how the method of ranking occurs. This article seems to be mostly additional information over the State of JS survey results and that additional information is useful without excess opinion or narratives.
A couple other good spots would be the react discord channel. Also the ##javascript channel of freenode. I tend to look on freenode (IRC) first when I've exhausted search options.
A lot of the details are based on implementations prior to ES6 in particular... and is inaccurate for any current implementation.
I tend to not like these 10-things in JavaScript type posts, as they're usually inaccurate or misleading... and in general remove or ignore them... here's some commentary and additional information regarding many of the questions specifically below.
1. What is closure in Javascript?
A closure in programming is the scope of a given variable. Traditionally in JavaScript closures have been limited to global or in the scope of a function (also, see: hoisting). As of ES6 const/let variables may be scoped to a more narrowly defined closure such as a loop or a defined curly-brace scoping.
For example, I now tend to manually create scopes in switch statement.
switch (x) {
case "somevalue": { // scope via curly braces
const foo = x; // scoped variable
...
}
...
}
2. What is DOM in Javascript?
Document Object Model (DOM) is the Application Programming Interface used by JavaScript in the context of a web browser in an interactive page/tab/instance, not to be confused with WebWorkers which have a different browser context.
The rest is mostly accurate in the post.
3. What is Promise in Javascript?
A promise is an class/object that *should* resolve or reject with a callback interface for resolve/reject value. It is used in conjunction with asynchronous code, but the API does not necessarily require it. It's also referred to as a thennable in practice.
4. What is a prototype in Javascript?
Prototype is the method of enheritance in JavaScript. It can be though of as a default search path. Class functions, and classes may have a prototype based inheritance change, and when accessing a property/method attached to an instance, the instance then the prototype and it's prototype in tern will then be searched.
This is slightly different than how inheritance works in other languages.
TFA is incorrect regarding Object.prototype as objects may inherit from null via Object.create(null) as an inheritance end point. This is to prevent accidental extension via Object where the behavior would be undesired.
5. What is hoisting in Javascript?
Mostly accurate.
6. What is an object in Javascript?
Other than some details regarding primitive values such as numbers, strings, null, undefined, and NaN; pretty much everything (including Arrays) in JavaScript is an object. An object is any given value that contains properties and a prototype chain.
7. What is a function in Javascript?
There's also the Function() constructor. Not to mention specifics around variations of functions in currently implementations including async, generator and fat-arrow functions (and context).
8. What is a pure function in Javascript?
Mostly correct.
9. What is a constructor in Javascript?
Constructor functions in JS are an implementation detail mostly about convention. Constructor functions are meant to be called/initialized via the "new" keyword and will by convention use CamelCase naming.
Ironically, the example is actually NOT a constructor function, as it uses a fat-arrow function which will bind "this" to the higher level context.
10. What are Javascript classes?
the class construct in JavaScript is mostly syntax sugar offering a different syntax for creating constructor functions and related prototype details. Instances are still prototype based.
At work, we're doing mostly Material-UI (React) and that uses JSS with a theme in the application. I find that using JSS with the extensions mui adds is harder to grasp for developers without good examples, but as the applications have matured, the use has as well.
I think JSS in general at a component level is easier than application CSS via more traditional approaches including BEM and others.
You do realize that when node started, there was no clear package mangager, and beyond that it was local only at the start. Also, there is absolutely nothing stopping you from creating a build system that separately pulls resources. Most modern package managers are http. Also, git ui offers something more immutable. And Deno caches remote modules, so you can still build, much like any other package manager when offline.
Personally, I'd like to see one of the package managers offerred so far rise to the top... but there's nothing wrong with creating something that works and letting people use it. Don't let perfect stand in the way of good.
As it is, I'm not actively using Deno at the moment, but have considered looking deeper into it. I'm curious how light of a containerized app I can get with Deno vs. Node. As it stands, the points of integration can get wonky.
I'm also hoping that FFI gets baked into Deno as it never was with Node (node-ffi notwithstanding is not baked in). There are very few reasons to use FFI in practice, especially with good wasm support. Multi-process SQLite access probably the most prominent example of a clear need for FFI, but I struggle to find more.
While I don't agree with all of the choices with deno, it's clearly developed with the hindsight from node's shortcomings, and there are many. NPM in particular has one massive shortcoming, in that it's very easy to create bloated use. Multi-tiered versions of packages combined with module vs commonjs entry points gets very bad.
On the one hand, I get it, npm won in the node sphere and in JS overall... it's what allowed the massive growth of the JS ecosystem as a whole. That doesn't mean it needs to be carried forward. Of course, if you look at the Python 2-3 migration, this is probably going to be a similar shift, if it happens at all. Node and Deno will coexist for at least a decade most likely.