loading
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
let hideNumber = function(string) {
    return string
      .replace(
        /\d/g, 
        '#####')
}

let hideNonNumbers = function(string) {
    return string
      .replace(
        /\D/g, 
        '#####')
}

let exampleSentence = "I entered the 2 e-mails [email protected] and [email protected] into the database."

console.log(hideNumber(exampleSentence))
console.log(hideNonNumbers(exampleSentence))
node v10.16.0