Comment faire de faux binaires

function fakeBin(x) {
  return x.replace(/\d/g, d => d < 5 ? 0 : 1);
}
// for code wars lol
TechWhizKid