DEV Community

Discussion on: JS: variable && function()

Collapse
 
kvnls profile image
KVNLS

You can use Optional chaining:
myFunction?.();

developer.mozilla.org/en-US/docs/W...

Collapse
 
winstonpuckett profile image
Winston Puckett

I didn't know they had optional chaining in JS! Thank you!