const oddNumbers = /[a-z]*\s*[0-9]*[1,3,5,7,9]\s*[a-z]*/g
function omitOdd(string){
if (oddNumbers.test(string)){
let token = /[0-9]+[1,3,5,7,9]|\s[1,3,5,7,9]\s/g
let res = string.replace(token," BEEP ")
console.log(res)
}else{
console.log("He is safe")
}
}
omitOdd("He has 203 cars, 10 are green, 11 are black and 3 are yellow")
Y29uc3Qgb2RkTnVtYmVycyA9IC9bYS16XSpccypbMC05XSpbMSwzLDUsNyw5XVxzKlthLXpdKi9nCgpmdW5jdGlvbiBvbWl0T2RkKHN0cmluZyl7CmlmIChvZGROdW1iZXJzLnRlc3Qoc3RyaW5nKSl7CiAgICBsZXQgdG9rZW4gPSAvWzAtOV0rWzEsMyw1LDcsOV18XHNbMSwzLDUsNyw5XVxzL2cKICAgIGxldCByZXMgPSBzdHJpbmcucmVwbGFjZSh0b2tlbiwiIEJFRVAgIikKICAgIGNvbnNvbGUubG9nKHJlcykKfWVsc2V7CiAgICBjb25zb2xlLmxvZygiSGUgaXMgc2FmZSIpCn0KfQoKb21pdE9kZCgiSGUgaGFzIDIwMyBjYXJzLCAxMCBhcmUgZ3JlZW4sIDExIGFyZSBibGFjayBhbmQgMyBhcmUgeWVsbG93Iik=