JSFiddle - React, Tailwind, and code Playground

JavaScript

function bin2dec(num){
    return num.split('').reverse().reduce(function(x, y, i){
      return (y === '1') ? x + BigInt(2) ** BigInt(i) : x;
    }, BigInt(0));
  }
  
alert(bin2dec('101110110001101000111100001110001000101000101011001100000011101'));