A Laravel(ish) Optional helper in Javascript

My attempt at creating an optional helper.

Laravels optional helper can be pretty useful. With its new optional closure you can do even more.

I wanted something similar in javascript so I wrote this based on my Laravel(ish) resource/transformer.

You can also provide a callback that will be called if the option exists.

Like what you read? Give Will Bowman a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.