Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed May 22, 2014
1 parent ffe0c94 commit 8f2a197
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@

## Example

Regular assertions evaluate all arguments and concatenate message
EVERY time, even if the condition is true.

```js
console.assert(typeof foo === 'object,
'expected ' + JSON.stringify(foo, null, 2) + ' to be an object');
// message is stringified and concatenated EVERY time no matter the condition
```
// vs
Lazy assertion function only evaluates its arguments and forms
a message if condition is false
```js
lazyAss(typeof foo === 'object', 'expected', foo, 'to be an object');
// foo variable is stringified and message is concatenated ONLY
// if condition is false
```
### Small print
Expand Down

0 comments on commit 8f2a197

Please sign in to comment.