{"action":"created","issue":{"url":"https://api.github.com/repos/lodash/lodash/issues/1148","labels_url":"https://api.github.com/repos/lodash/lodash/issues/1148/labels{/name}","comments_url":"https://api.github.com/repos/lodash/lodash/issues/1148/comments","events_url":"https://api.github.com/repos/lodash/lodash/issues/1148/events","html_url":"https://github.com/lodash/lodash/issues/1148","id":69568538,"number":1148,"title":"_.isNumeric","user":{"login":"brandoncarl","id":5427971,"avatar_url":"https://avatars.githubusercontent.com/u/5427971?v=3","gravatar_id":"","url":"https://api.github.com/users/brandoncarl","html_url":"https://github.com/brandoncarl","followers_url":"https://api.github.com/users/brandoncarl/followers","following_url":"https://api.github.com/users/brandoncarl/following{/other_user}","gists_url":"https://api.github.com/users/brandoncarl/gists{/gist_id}","starred_url":"https://api.github.com/users/brandoncarl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandoncarl/subscriptions","organizations_url":"https://api.github.com/users/brandoncarl/orgs","repos_url":"https://api.github.com/users/brandoncarl/repos","events_url":"https://api.github.com/users/brandoncarl/events{/privacy}","received_events_url":"https://api.github.com/users/brandoncarl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lodash/lodash/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/lodash/lodash/labels/wontfix","name":"wontfix","color":"ffffff"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-04-20T11:41:04Z","updated_at":"2015-09-17T17:39:24Z","closed_at":"2015-04-20T15:13:04Z","body":"Hi all –\r\n\r\nI know that `isFinite` and `isNumber` and `isNaN` have been discussed ad nauseum, but I think they leave a big gap in functionality.\r\n\r\nGiven that JS is not typed, when working with third-party data, it's often important to check whether something is \"numeric\".\r\n\r\nThis would function as follows:\r\n```js\r\n_.isNumeric() // => false\r\n_.isNumeric(undefined) // => false\r\n_.isNumeric(null) // => false\r\n_.isNumeric(new Number()) // => false\r\n_.isNumeric(Infinity) // => false\r\n_.isNumeric(15.5) // => true\r\n_.isNumeric(\"15.5\") // => true\r\n```\r\nI find that I'm often cobbling together some combination of functions to achieve this. I believe that it could be solved with something like the following.\r\n\r\n```js\r\nfunction isNumeric(x) {\r\n  return !(isNaN(x)) && (typeof x === \"object\") &&\r\n    (x != Number.POSITIVE_INFINITY) && (x != Number.NEGATIVE_INFINITY);\r\n}\r\n```\r\n\r\nCheers!"},"comment":{"url":"https://api.github.com/repos/lodash/lodash/issues/comments/141162371","html_url":"https://github.com/lodash/lodash/issues/1148#issuecomment-141162371","issue_url":"https://api.github.com/repos/lodash/lodash/issues/1148","id":141162371,"user":{"login":"jdalton","id":4303,"avatar_url":"https://avatars.githubusercontent.com/u/4303?v=3","gravatar_id":"","url":"https://api.github.com/users/jdalton","html_url":"https://github.com/jdalton","followers_url":"https://api.github.com/users/jdalton/followers","following_url":"https://api.github.com/users/jdalton/following{/other_user}","gists_url":"https://api.github.com/users/jdalton/gists{/gist_id}","starred_url":"https://api.github.com/users/jdalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdalton/subscriptions","organizations_url":"https://api.github.com/users/jdalton/orgs","repos_url":"https://api.github.com/users/jdalton/repos","events_url":"https://api.github.com/users/jdalton/events{/privacy}","received_events_url":"https://api.github.com/users/jdalton/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T17:39:24Z","updated_at":"2015-09-17T17:39:24Z","body":"I'm referring to the built-in global `isFinite` method and not the `_.isFinite`."}}