Untitled
unknown
plain_text
a year ago
258 B
2
Indexable
Never
function fakeBin(x){ let newArr = Array.from(x); for (let i = 0; i <= newArr.length; i += 1) { if (Number(newArr[i]) < 5) { newArr.splice(i, 1, '0'); } if (Number(newArr[i]) >= 5) { newArr.splice(i, 1, '1'); } } return newArr.join(''); }