jsfakeit
Version:

15 lines (14 loc) • 426 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.replaceWithNumber = void 0;
function replaceWithNumber(s) {
const arr = Array.from(s);
for (let i = 0; i < arr.length; i++) {
if (arr[i] === '#') {
let n = Math.floor(Math.random() * 10);
arr[i] = n.toString();
}
}
return arr.join('');
}
exports.replaceWithNumber = replaceWithNumber;