Getting all positions of bit 1 in javascript? : <p>I have provided binary for example, <code>01001</code>, and would like to get positions of bit 1, so I expect it will return me <code>[0, 3]</code>.</p>

<p>Is there any function provided by javascript to get all positions of bit 1?</p>
