
A JavaScript Playground Is the Fastest Way to Test an Idea
The friction between having an idea and testing it should be as close to zero as possible. When you wonder "does Array.flat() work with nested arrays three levels deep?" or "what does Date.parse return for this weird format?" the answer should take seconds, not minutes. Opening a full project, creating a scratch file, running it, and cleaning up afterward is too much overhead for a quick test. A JavaScript playground gives you an instant execution environment with zero setup. What to use a playground for Testing language features. JavaScript has quirks that are faster to test than to look up. Does typeof null return "null" or "object"? (It returns "object" -- a famous bug from JavaScript's first implementation that can never be fixed without breaking the web.) typeof null // "object" typeof undefined // "undefined" typeof NaN // "number" -- NaN is technically a number typeof [] // "object" typeof {} // "object" Array . isArray ([]) // true -- use this instead Exploring APIs. When learn
Continue reading on Dev.to JavaScript
Opens in a new tab




