Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if("hello".indexOf("world")) { // I forgot to add > -1 here
- console.log("hello world");
- }
- +-----------------------------------------------------------------------+
- | Argument Type | Result |
- |:--------------|------------------------------------------------------:|
- | Undefined | false |
- |---------------|-------------------------------------------------------|
- | Null | false |
- |---------------|-------------------------------------------------------|
- | Boolean | The result equals the input argument (no conversion). |
- |---------------|-------------------------------------------------------|
- | Number | The result is false if the argument is +0, −0, or NaN;|
- | | otherwise the result is true. |
- |---------------|-------------------------------------------------------|
- | String | The result is false if the argument is the empty |
- | | String (its length is zero); otherwise the result is |
- | | true. |
- |---------------|-------------------------------------------------------|
- | Object | true |
- +-----------------------------------------------------------------------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement