since 1.0.0
Verify if one or more variables is not equals to one or more values.
This function do not return a boolean result. It is necessary to use alongside with result() to obtain the boolean result.
The following table presents all parameters combination that can be used in this function.
PARAMETERS | SINCE | DESCRIPTION |
---|---|---|
string | 1.0.0 | Compare the value of one variable |
array | 1.0.0 | Compare the value for multiple variables |
Verify if a variable is not equals to the given value.
utm.is('utm_source')
.not('google')
Using result() to obtain the boolean result.
let result = is('utm_source').not('google').result()
Using then() to execute a function when the result is true.
.is('utm_source')
.not('google')
.then(() => console.log('it is not google'))
Verify if a variable is not equals to any one the given values.
utm.is('utm_source')
.not(['google', 'facebook'])
Verify if all variables are not equals the given value.
utm.is(['utm_source', 'utm_campaign'])
.not('google')
Verifies if each variable from is() is not equals to the given value in the same position of not().
It will be true only if utm_source is not equals google and utm_medium is not equals cpc.
utm.is(['utm_source', 'utm_medium'])
.not(['google', 'cpc'])
A more complex verification can also be performed.
For example, verify if utm_source is different from both google or facebook and if utm_medium is not equals cpc.
utm.is(['utm_source', 'utm_medium'])
.not([['google', 'facebook'], 'cpc'])