is.blackbarry
is.blackbarry(target: unknown)โ
The is.blackberry
method is used to determine if the current device is a BlackBerry mobile device.
The method works by checking the user agent string of the current device against known patterns associated with BlackBerry devices. If a match is found, the method returns true
, otherwise it returns false
.
Specificationโ
- Target argument: optional.
- Return: boolean.
Informationโ
- Unit tests: โ
Data used for examples
const userAgent = 'Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.342 Mobile Safari/534.11+';
Examplesโ
is.blackbarry() // true if the command is executed in a browser running on the blackbarry
is.blackbarry(userAgent) // true
// Alternative
IsConfig.state.userAgent = userAgent;
is.blackbarry() // true
is.blackbarry(769) // false
is.blackbarry(false) // false
is.blackbarry(new Boolean(0)) // false
is.blackbarry(new Boolean()) // false
is.blackbarry(0) // false
is.blackbarry('') // false
is.blackbarry({}) // false
is.blackbarry([]) // false
// And all other known types will return false
Reversal boolean resultโ
is.not_blackbarry() // false if the command is executed in a browser running on the blackbarry
is.not_blackbarry(userAgent) // false
// Alternative
IsConfig.state.userAgent = userAgent;
is.not_blackbarry() // false
is.blackbarry(769) // true
is.blackbarry(false) // true
is.blackbarry(new Boolean(0)) // true
is.blackbarry(new Boolean()) // true
is.blackbarry(0) // true
is.blackbarry('') // true
is.blackbarry({}) // true
is.blackbarry([]) // true
// And all other known types will return true