Skip to content

The "Is" library from jumpkick-studios: "a better way to write JavaScript conditional statements and still have pretty code"

Updated: at 05:43 PM

Use “Is” to flatten out your if-then-else logic flow and handle exceptions

Convert nested and possibly repeated if-then-else statement with this example:

var foo = 'bar';

Is(foo)
  .longerThan(0)
  .equalTo('bar')
  .not.equalTo('bar2')
  .then(() => {
    console.log('success');
  })
  .catch(() => {
    throw new Error('bad foo');
  });

Read more at github.com