Tagged articles
9 articles
Page 1 of 1
JavaScript
JavaScript
May 29, 2025 · Frontend Development

Master JavaScript Optional Chaining and Nullish Coalescing for Cleaner Code

This article explains how the optional‑chaining (?.) and nullish‑coalescing (??) operators simplify deep object access and default‑value handling in JavaScript, offering concise, safe alternatives to verbose if‑else checks, try‑catch blocks, and the logical‑or operator.

Code CleanlinessJavaScriptfrontend
0 likes · 3 min read
Master JavaScript Optional Chaining and Nullish Coalescing for Cleaner Code
JavaScript
JavaScript
Mar 8, 2025 · Frontend Development

Mastering JavaScript’s Nullish Coalescing (??) Operator: When to Use It Over ||

Learn how JavaScript’s nullish coalescing (??) operator works, its key differences from the logical OR (||) operator, and see practical examples—from handling default form values to chaining defaults and combining with optional chaining—plus performance considerations and advanced patterns.

?? operatorDefault ValuesJavaScript
0 likes · 6 min read
Mastering JavaScript’s Nullish Coalescing (??) Operator: When to Use It Over ||
Sohu Tech Products
Sohu Tech Products
Feb 26, 2025 · Frontend Development

Automatically Adding Optional Chaining Operator via Babel Plugin to Prevent TypeError

An automatically applied Babel plugin scans JavaScript AST nodes and rewrites risky property accesses and logical‑AND chains into optional‑chaining expressions, letting developers prevent TypeError crashes without modifying source code, while offering include/exclude filters, optional short‑circuit optimization, and compatibility with older browsers via downstream transforms.

AST transformationJavaScriptPlugin Development
0 likes · 11 min read
Automatically Adding Optional Chaining Operator via Babel Plugin to Prevent TypeError
vivo Internet Technology
vivo Internet Technology
Jan 22, 2025 · Frontend Development

Developing a Babel Plugin to Automatically Add Optional Chaining (?.) and Prevent TypeError

The article explains how to create a custom Babel plugin that automatically transforms risky member and call expressions into optional‑chaining equivalents during bundling, using configurable include/exclude patterns and short‑circuit optimizations, thereby preventing TypeError in large JavaScript codebases while noting a modest bundle‑size increase.

JavaScriptPlugin DevelopmentTypeError Prevention
0 likes · 14 min read
Developing a Babel Plugin to Automatically Add Optional Chaining (?.) and Prevent TypeError
JavaScript
JavaScript
Dec 16, 2024 · Frontend Development

Master Optional Chaining and Nullish Coalescing in JavaScript

This article explains how JavaScript's optional chaining (?.) and nullish coalescing (??) operators simplify safe access to nested object properties and provide reliable default values, replacing older verbose patterns with concise, readable code.

Code ExamplesES2020JavaScript
0 likes · 7 min read
Master Optional Chaining and Nullish Coalescing in JavaScript
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Aug 9, 2024 · Frontend Development

Deep Data Access in JavaScript: Building the anypath Library for Reading and Writing Nested Structures

This article explains the challenges of reading and writing deeply nested data in JavaScript, introduces native optional‑chaining and TypeScript solutions, and walks through the design and implementation of a reusable anypath library that supports objects, arrays, Maps and Sets.

JavaScriptLibrary DevelopmentTypeScript
0 likes · 13 min read
Deep Data Access in JavaScript: Building the anypath Library for Reading and Writing Nested Structures
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
May 19, 2024 · Frontend Development

Deep Data Access in JavaScript and Building the anypath Library

This article examines the challenges of reading and writing deeply nested JavaScript data, explains why traditional defensive checks fail, introduces optional chaining and TypeScript strict null checks, and presents the anypath library with setany/getany functions that automatically create missing objects or arrays while supporting future extensions for Map and Set.

LibraryTypeScriptanypath
0 likes · 11 min read
Deep Data Access in JavaScript and Building the anypath Library
21CTO
21CTO
Dec 1, 2022 · Frontend Development

Say Goodbye to Bad JavaScript Practices: 8 Essential Tips for Clean Code

This article outlines eight practical JavaScript habits—using let/const, writing meaningful comments, preferring == over ===, leveraging optional chaining, avoiding magic values, handling async errors, passing multiple parameters instead of a single object, and using concise conditionals—to produce more maintainable, readable, and robust code.

Error HandlingJavaScriptclean code
0 likes · 7 min read
Say Goodbye to Bad JavaScript Practices: 8 Essential Tips for Clean Code