binary to int javascript

JavaScript
let binary = 0001
parseInt(binary, 2)
// returns 1
Source

Also in JavaScript: