since 1.0.0
Receives a function as parameter that will be executed when the action performed together with is() resulted in false.
utm.otherwise( function() { ... } )
The following table presents all parameters combination that can be used in this function.
PARAMETERS | SINCE | DESCRIPTION |
---|---|---|
function | 1.0.0 | Executes the given function if the performed comparison returns false |
The message source is not google
will be displayed in console when utm_source != google.
utm.is('utm_source')
.equals('google')
.then(() => {
console.log('source is google')
} )
.otherwise(() => {
console.log('source is not google')
})
Using the function then() is optional.
utm.is('utm_source')
.equals('google')
.otherwise(() => {
console.log('source is not google')
} )