I'm seeing quite a bit of usage of !0
and !1
within the source code for jQuery and Telerks' JS. I've most seen it in return statements which may have some bearing on it's usage.
What is the purpose? Is this some sort of optimization?
It's a trick for minifying:
!0 === true
!1 === false
It just does the same thing with less characters.
I guess technically it is an optimization, but not one I encourage you to do by hand. a minifier will do this for you.
It's simply to return a boolean value.
!0 == true // because 1 is true, 0 is false, so NOT 0 is true.
!1 == false // same as above logic but flipped.
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I am currently working on a blog in backbone - now previously to this any backbone app I created has been fairly small so i should fetch all my collection on the initialisation on the app, store it in collections and pass them collections through to my view for usage
I have a set of tabs here: http://thetalbotcuckfieldco