
Syntax - Tasty Web Development Treats Hasty Treat - Stump'd
Sep 2, 2019
Dive into a playful battle of wits as the hosts tackle tricky interview questions in a lively game! Discover the quirky differences between 'null' and 'undefined' in JavaScript. Unpack static class properties and learn about the reliability of pure functions. Explore the historical use of JSONP for cross-origin communication. Finally, get a grasp on the CSS box model and its essential components—content, padding, border, and margin. A delightful mix of humor and insights awaits!
AI Snips
Chapters
Transcript
Episode notes
Null vs. Undefined
nullis explicitly nothing, whileundefinedis the absence of a value.- Use
nullto set a variable to nothing andundefinedwhen a variable hasn't been assigned a value.
Short-Circuit Evaluation
- Short-circuit evaluation stops evaluating conditions once the outcome is determined.
- This occurs with logical AND/OR and some array methods like
.find.
Use Strict
use strictenables strict mode in JavaScript, enforcing stricter parsing and error handling.- It helps eliminate bad practices and allows use of newer features, often enabled by default in ES modules.
