Skip to content

Instantly share code, notes, and snippets.

@Alex1990
Created August 18, 2014 02:02
Show Gist options
  • Save Alex1990/943f6578a744ca6d44d1 to your computer and use it in GitHub Desktop.
Save Alex1990/943f6578a744ca6d44d1 to your computer and use it in GitHub Desktop.
check if the digit of the number is expected
// when you need a range, you'd better use comparison operators
function isFullYear(year) {
return !/^\d{4}$/.test(year);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment