javascript validate number only

Solutions on MaxInterview for javascript validate number only by the best coders in the world

showing results for - "javascript validate number only"
Gael
18 Sep 2018
1function validateNumber(e) {
2            const pattern = /^[0-9]$/;
3
4            return pattern.test(e.key )
5        }