// objective:
// Convert a binary number into a decimal number

// solution:
const assert = require("assert");

const SimpleMode = arr => {
  return parseInt((arr + "")
    .replace(/[^01]/gi, ""), 2);
};

console.log(SimpleMode("5,5,2,2,1"));
const r1 = "5";
assert(r1);

// objective:
// Convert a binary number into a decimal number

// solution:
const assert = require("assert");

function SimpleMode(bstr) {
  return parseInt((bstr + "").replace(/[^01]/gi, ""), 2);
}

// console.log(SimpleMode("11001"));

const r1 = "5";
assert(r1);

add working test, edit function