How to check if a string contains a digits with javascript?
I need to know if there is a number in a string.
I have this idea:
let string = 'sdfgslkdfg76856sdfgsdfg';
if (Number(string) > 0) {
....
} else {
....
}
Is there is a better way?
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
How to check if a string contains a digits with javascript?
I need to know if there is a number in a string.
I have this idea:
let string = 'sdfgslkdfg76856sdfgsdfg';
if (Number(string) > 0) {
....
} else {
....
}
Is there is a better way?