TypeError: Cannot read property 'indexOf' of undefined
<p>Node is giving this error while checking the occurrence of a substring:</p>
<blockquote>
<p>TypeError: Cannot read property 'indexOf' of undefined'</p>
</blockquote>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var withdraw = project.withdrawal;
                var uemail = user.eamil;
                var ans = withdraw.indexOf(uemail) &gt; -1;</code></pre>
</div>
</div>
</p>