showing results for - "string contains at least one number"
Iker
06 Oct 2017
1// String with some numbers
2const str = "Hello12345World!";
3
4// Regular expression
5const regex = /\d/;
6
7// Check if string contians numbers
8const doesItHaveNumber = regex.test(str);
9
10console.log(doesItHaveNumber); // true