Hello in this jQuery video I am going to show you the is numeric method. So the is numeric method just checks if the argument provided is a valid number. So if I do console dot log and to do is numeric method has to dollar.is a path in a number here to Pisces six this year return true. Okay so if I duplicate this and I change it to the string hello, this should return okay so far so good. What happens if we do a negative number? Just FYI, let's do like negative 50 635.
So we are doing a negative decimal still says two because that is the number one if I do this quotation marks for a number and this is string It comes up as true. So this is where it gets interesting. So this is the really cool thing about is numeric. So if you, you know, are getting some input from the user, and it's either a string or you've got them from somewhere else, for example, and you want to check if it's a number, but you don't want to do any casting, you can use this. So that way, you can still manipulate this if it's assigned into some variable as a string, we can check it with a number. But what would happen if I were to duplicate this and add, you know, the letter U at the end it call up a fourth because this is no longer a number.
So this is saying, even if not the sentence, these quotation marks when they're 67, you will not be a valid number. So that's the is numeric method in jQuery. Really, really cool, really easy to use, but really, really useful. Thanks for watching, and I look forward to seeing you in the next video.