Skip to content

Instantly share code, notes, and snippets.

@jensarps
jensarps / dieassert.js
Created May 10, 2012 08:50 — forked from jeromeetienne/dieassert.js
a console.assert which actually stop the execution
/**
* [Forked from https://gist.github.com/2651899]
*
* A console.assert which actually stop the exectution.
* default console.assert() is a plain display, such as console.log() or console.error();
* It doesnt stop the execution like assert() is meant to do. This is a little code to
* "workaround this limitation" :)
*
* Usage:
* console.assert(foo === bar); // Will throw if not equal