Alternative for long if..else/switch chain in javascript
<pre><code> var ifChecks = function( i )
 {
     if( i === 23 )
     {
       // implementation
     }
     else if ( i === 300 )
     {
       // implementation
     }
     else if ... 

  }
</code></pre>

<p>I have this kind of long if else chain (app. 60 checks) in javascript code, this lengthy chain is inefficient as if 60th check comes as input, then it has to unnecessarily go through 59 checks, so I thought to implement like this.</p>

<pre><code> var implobj = { 23 : handleimpl1,
                 300 : handleimpl2,
                 .
                 .
                 .
               }
 var handleImpl = function( i )
 {
    implobj[i]();
 }
</code></pre>

<p>Is there any other way better than this solution which can be implemented in javascript? </p>

<p>Note: input is not sequential number, otherwise I could have used array instead of object.</p>
