isjs icon indicating copy to clipboard operation
isjs copied to clipboard

Create an opposite function `isnt`

Open rthor opened this issue 11 years ago • 0 comments

I've been brainstorming on the idea of having an opposite function, i.e. isnt(). This would simply return a reversed boolean value from the is() function. The benefits are more readable tests and users can stop banging the is:

if ( ! is('[email protected]', 'email') ) { ... }

A simple solution would be to add a function at the bottom of each script called isnt which returns a reversed is. For example, the jQuery plugin could implement the following:

$.isnt = function () { return !$.is; };
$.fn.isnt = function () { return !$.fn.is; };

More elegant solution would be preferable - Chat away :smile:

rthor avatar Aug 05 '13 12:08 rthor