I wrote a Babel plugin which brings a similar syntax to JavaScript, so you can write this:<p><pre><code>    for (let i = 0; i &lt; someVar; i++) {
       invariant: i &lt; 10000; 
       console.log(i);
    }
</code></pre>
along with other kinds of contract, like preconditions and postconditions - <a href="https:&#x2F;&#x2F;github.com&#x2F;codemix&#x2F;babel-plugin-contracts" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;codemix&#x2F;babel-plugin-contracts</a>