Assert value with condition - Node.js Data Type

Node.js examples for Data Type:Error

Description

Assert value with condition

Demo Code

function assert(condition, message) {
    if (!condition) {
        throw new Error(message);
    }/*from   w  w  w . j  a v a 2s  .  c om*/
}

Related Tutorials