JSFiddle - React, Tailwind, and code Playground

by oeffe

JavaScript

var val = "adad3"

console.log()


function isNumber(val) {
  if (!val) return false;
  return /^-?\d+$/.test(val);
}

function isString(val) {
  if (!val) return false;
  return /([a-zA-Z])/.test(val);
}