Skip to content

Instantly share code, notes, and snippets.

@jokeyrhyme
Created December 9, 2013 23:42
Show Gist options
  • Save jokeyrhyme/7883136 to your computer and use it in GitHub Desktop.
Save jokeyrhyme/7883136 to your computer and use it in GitHub Desktop.
quick assertions for demonstrating JavaScript stuff in jsFiddle, codepen, etc
p.failed {
color: red;
}
function assert(expected, message) {
var p$ = $('<p></p>');
if (!expected) {
p$.addClass('failed');
}
p$.text(message);
p$.appendTo(document.body);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment