JavaScript
from2ality
8 hours agoLearning web development: JavaScript Maps
Map stores key-value pairs allowing lookup, insertion, and existence checks, and can use objects as keys with strict (===) identity comparison.
During its lifetime, JavaScript has had several names: During development, its name was Mocha. In the Netscape Navigator 2.0 betas (September 1995), it was called LiveScript. In Netscape Navigator 2.0 beta 3 (December 1995), it got its most common name, JavaScript. Why that name? JavaScript was going to be a glue language for components written in Java. The first standard for JavaScript was published in 1997, hosted by Ecma International (called ECMA at the time).
As you were browsing something about your browser made us think you were a bot. There are a few reasons this might happen: You've disabled JavaScript in your web browser. You're a power user moving through this website with super-human speed. You've disabled cookies in your web browser. A third-party browser plugin, such as Ghostery or NoScript, is preventing JavaScript from running. Additional information is available in this support article.
Promises have long been our go-to when working with asynchronous code in JavaScript. If you've used Promise.all() or Promise.race() to coordinate async operations, you know the patterns. But what if you're only interested in the first successful result, ignoring failures? That's exactly what Promise.any() does: it fulfills with the first resolved promise and ignores any that reject (unless all reject).
This time, we're going dynamic. In this final chapter, we're stepping into the world of interactivity by adding JavaScript into the mix. We'll start by generating the layers programmatically, giving us more flexibility and cleaner code (and we'll never have to copy-paste divs again). Then, we'll add some interaction. Starting with a simple :hover effect, and ending with a fully responsive bulging text that follows your mouse in real time. Let's go.
If you already know JavaScript, learning Python will feel easier because many core concepts are the same. Both languages use similar data types (strings, numbers, lists/arrays, objects/dictionaries), functions with default parameters, and control flow (loops, conditionals). The biggest differences are in syntax: Python relies on indentation instead of curly braces, uses keywords like def instead of function, and is generally more concise. Your JavaScript knowledge gives you a strong head start-you'll just need to adjust to Python's style and rules.
Internationalization involves more than just text translation; it encompasses formatting dates, pluralization, and sorting according to cultural expectations. The Intl API allows modern JavaScript to handle these tasks natively.
Generative AI platforms such as ChatGPT and Claude require websites to be crawlable by AI bots for effective mentions and citations. Disabling JavaScript improves crawlability, as many AI crawlers struggle with JavaScript rendering, which differs from Google’s capabilities. This means publishers must ensure essential content is accessible even without JavaScript. AI optimization tools like Aiso can evaluate and enhance a site's crawlability, providing suggestions for improvement. Site owners must also verify their robots.txt files to allow AI bot access, as many content management systems restrict bots by default.
In a newly discovered supply chain attack, attackers last week targeted a range of npm-hosted JavaScript type testing utilities, several of which were successfully compromised to distribute malware.
"This was a stealth miner, designed to avoid detection by staying below the radar of both users and security tools," security researcher Himanshu Anand said.