What is “assert” in JavaScript?
问题 What does assert mean in JavaScript? I’ve seen something like: assert(function1() && function2() && function3(), "some text"); And would like to know what the method assert() does. 回答1: There is no assert in JavaScript (yet; there's talk of adding one, but it's at an early stage). Perhaps you're using some library that provides one. The usual meaning is to throw an error if the expression passed into the function is false; this is part of the general concept of assertion checking. Usually