1

I have times in my JS code where a function may be undefined, and I want to call it only if it's defined. I write function && function(). Is there a more concise way to do this? Something like function.callIfExists()?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
gkeenley
  • 6,088
  • 8
  • 54
  • 129

0 Answers0