What is “assert” in JavaScript?

后端 未结 14 732
-上瘾入骨i
-上瘾入骨i 2020-12-04 05:03

What does assert mean in JavaScript?

I’ve seen something like:

assert(function1() && function2() && function3(), \"some          


        
14条回答
  •  误落风尘
    2020-12-04 05:27

    If using a modern browser or nodejs, you can use console.assert(expression, object).

    For more information:

    • Chrome API Reference
    • Firefox Web Console
    • Firebug Console API
    • IE Console API
    • Opera Dragonfly
    • Nodejs Console API

提交回复
热议问题