There’s no isNumeric()
type of function, but you could add your own:
function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
NOTE: Since parseInt()
is not a proper way to check for numeric it should NOT be used.
More Related Contents:
- Switching to the new function writing format
- $(document).ready equivalent without jQuery
- Assigning prototype methods *inside* the constructor function – why not?
- How to get a word under cursor using JavaScript?
- Dynamically set property of nested object
- document.getElementById vs jQuery $()
- How do I update/upsert a document in Mongoose?
- Permutations in JavaScript?
- DOM event precedence
- Are there pointers in javascript?
- javascript search array of arrays
- JavaScript accessing inner DOM of SVG
- How to remove a class from elements in pure JavaScript?
- javascript get x and y coordinates on mouse click
- JavaScript Array: get “range” of items
- Generating unique random numbers (integers) between 0 and ‘x’
- Converting punycode with dash character to Unicode
- How run async / await in parallel in Javascript
- XMLHttpRequest cannot load, No ‘Access-Control-Allow-Origin’ header is present on the requested resource [duplicate]
- Setting DIV width and height in JavaScript
- jQuery: checking if the value of a field is null (empty)
- Looping over urls to do the same thing
- GmailApp – Add label to specific message, not the thread
- lodash debounce not working in anonymous function
- Why if([]) is validated while [] == false in javascript?
- Using reduce() to find min and max values?
- contenteditable div backspace and deleting text node problems
- Programmatically accessing function scope using Chrome DevTools console
- Add / Change parameter of URL and redirect to the new URL
- Making a live clock in javascript