-
Notifications
You must be signed in to change notification settings - Fork 480
using-jquery-core/utility-methods: add type checking section #597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@dmethvin can you give this a review? |
$.type( new Date() ); // "date" | ||
``` | ||
|
||
Since jQuery 1.9, `$.type()` will return `error` when calling it on error objects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just let people read the docs for the details, to keep this simple.
3743c09
to
35ee056
Compare
@RedWolves @dmethvin Updated my PR. |
👍 |
$.isNumeric(3.14); // true | ||
``` | ||
|
||
Aditionally, there is `$.type()` which checks for the internal class used to create a value. You can see the method as a better alternative for the `typeof` operator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally is misspelled.
35ee056
to
72f8b3e
Compare
@@ -44,4 +44,4 @@ if ( Object.prototype.toString.call( myArray ) === "[object Array]" ) { | |||
} | |||
``` | |||
|
|||
jQuery also offers utility methods to help determine the type of an arbitrary value. | |||
jQuery also offers [utility methods](../using-jquery-core/utility-methods.md#testing-type) to help determine the type of an arbitrary value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link doesn't work it goes to /javascript-101/using-jquery-core/utility-methods.md#testing-type
You don't need the ../
You also don't need the .md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you do need a leading /
this will work /using-jquery-core/utility-methods#testing-type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RedWolves fixed.
72f8b3e
to
dac22f2
Compare
@RedWolves Any more review on this? |
nope looks good. Want to go ahead and land this? You have access now it looks like. |
This PR adds info about type checking utility methods to
using-jquery-core/utility-methods
. Would fix #404 on the while.