DEV Community

Sam Clark
Sam Clark

Posted on

1 2

Horrible Snippets - Check the string

Usecase
Let's say you're looking to implement a darklaunch feature, you have some options, you can pass a bunch of env vars(RUN_EVENT_1=true, etc.) OR you can just pass a DARK_LAUNCH flag with some comma separated vars.

const stringydingy = 'foo,bar,baz';

stringydingy.split(',').includes('foo');

if(stringydingy.split(',').includes('foo')) {
  runDarkLaunchDotCalm();
}

Play with it, try it out in your project! Give me feedback on how it can be improved!

Top comments (0)

nextjs tutorial video

Youtube Tutorial Series 📺

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series