Check if the given argument is a string Use typeof to check if a value is classified as a string primitive. Only works for string primitives. const isString = val => typeof val === 'string'; // Example isString('10'); // true Source https://www.30secondsofcode.org/js/s/is-string