← back

Horrible Snippets - Check the string

Usecase

Sometimes you want to implement a dark-launch feature. Instead of passing a bunch of environment variables, you can use a single DARK_LAUNCH flag with comma-separated values.

const stringydingy = 'foo,bar,baz';

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

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

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