Python is EAFP, and Swift is LBYL. What is the best choice for Javascript?<p>For those who don't know:<p>EAFP: Easier to Ask Forgiveness than Permission (try/catch)
LBYL: Look Before You Leap (if condition: do thing)
Creating something that works in JavaScript requires hooking lots of libraries together. A recent bare-bones API project I was working on had 70 libraries (only 10 of which were surface-level, the rest were dependencies).<p>Unfortunately, there isn't much of a standard in how libraries do things, so you won't ever have a cohesive standard in your own code.<p>For that reason, I suggest using whatever style creates more readable/maintainable code for you and your team. I suspect that it's LYBL, since that helps you avoid goto-based functionality, but it's a personal choice.