Check if string starts with a number [duplicate] December 12, 2023 by Tarik You can use a regular expression: if (s.match(/^\d/)) { // Return true } if (f.match(/^\d/)) { // Return false }