3 ms·
As an aside around dealing with properties that don't exist yet, I have found the following pattern very useful. It greatly reduces the number of checks I have
by rsuelzer 12y ago
As an aside around dealing with properties that don't exist yet, I have found the following pattern very useful. It greatly reduces the number of checks I have to do in an if statement and has made my code more maintainable by reducing the amount of boilerplate code I need to write inside of functions.
http://adripofjavascript.com/blog/drips/making-deep-property-access-safe-in-javascript.html http://adripofjavascript.com/blog/drips/making-deep-property...
- wereHamster 12y agoThat avoids runtime exceptions, but won't save you from typos.