Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 2
    +1, a little comment: For allTrue, you can also use array.every with a function returning the array element value. Commented Apr 25, 2012 at 14:08
  • 2
    JSON.stringify(null) === 'null' (the string "null"), not null. Commented Aug 23, 2013 at 18:22
  • Oops, it seems back in the day I was in a rush and tricked myself into misreading someone's comment, and so said an irrelevant falsehood (that JSON.stringify(null)=='"null"'). I still do not see a problem in relation to OP's question with respect to any undefineds or nulls that I have not mentioned in my answer. Therefore I stand by my answer and its demo tests. Commented Mar 30, 2014 at 4:50
  • JSON.stringify does not guarantee you that it converts an object to the same string. each time. Commented Aug 19, 2015 at 15:21
  • yes, that's exactly what I already said, though I guess I'll bold it for clarity or something Commented Sep 4, 2015 at 18:54