you can use JavaScript's multi-line comment, whichbegins with /* andends with*/. The interpreter will ignore everything between the opening /* and */ in the code block above. These comments are "Block comments"
Every time you create an instance of the class usingnewoperator (e.g.myGreeter = new Greeter('World')), methods are available for invocation on the created instance. myGreeter.greet()is how you invoke the methodgreet()on the instance. What's important is thatthisinside of the method equa...
This post’s description of promises leaves out the possibility of failure. Promises do not always get resolved to a value; sometimes they are “rejected” with an error. I’ll describe this in a future post. This post also leaves out any implementation details. I’ll also do a post show...
What are symbols in JavaScript? I stumbled across “symbols” when reading about JavaScript iterators. Here’s what I saw:const myIterable = {}; myIterable[Symbol.iterator] = () => { /* ... */ };An iterable has the unusual property Symbol.iterator, but what on earth is Symbol....
Promises can also create chains, which are useful in handling multiple dependent async operations. If you'd like to read more about promises andasync/awaitfrom a practical side, I recommend checkingHow to Use Fetch with async/await. Challenge: do you know the one important difference betweenprom...
asked me this morning what "anonymous functions" are in JScript.It's a little complicated. Two things come to mind: realio-trulio anonymous functions, and what we used to call "scriptlets".First up are actual anonymous functions -- functions which do not have names are, unsurprisingly enough...
With the exception of a few twists (which I’ll point out in this article), these databases provide their data most commonly through HTTP, store their data as JavaScript Object Notation (JSON) documents and provide APIs in multiple languages. The overall concerns are simplicity, speed and scala...
Objects can be grouped into three categories: custom objects are defined by us developers, built-in objects defined by the JavaScript spec, and host objects provided by the host (browser) environment[4].All custom functions defined by us developers have the [[construct]] property, being able ...
In other words, a closure gives you access to an outer function’s scope from an inner function. In JavaScript, closures are created every time a function is created, at function creation time.What Is Scope?Scope is access; that’s the easiest way to think about it. Scope allows you, ...
Topic Web Development Languages What Is Node.js and Why You Should Use It Node.js is a highly-scalable event-driven JavaScript environment. In this article, learn more about Node.js, its architecture, how to use it, and m… Reading time ...