Skip to main content
Version: Next

is.ie

is.ie(target: unknown)โ€‹

is.ie is a function that returns a boolean value indicating whether the current browser is Internet Explorer. It works by checking the user agent string of the browser, which contains information about the browser and its version.

Note that relying on the user agent string for browser detection can be unreliable, as the user agent string can be easily spoofed. It's generally better to use feature detection rather than browser detection whenever possible.

Specificationโ€‹

  • Target argument: optional.
  • Return: boolean.

Informationโ€‹

  • Unit tests: โœ…

Examplesโ€‹

is.ie() // true if the command is executed in the ie browser
is.ie('Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)') // true

// Alternative
isConfig.state.userAgent = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)';
is.ie() // true

// Recomendation
is.browser_ie();

is.ie(false) // false
is.ie(new Boolean(0)) // false
is.ie(new Boolean()) // false
is.ie(0) // false
is.ie('') // false
is.ie({}) // false
is.ie([]) // false
// And all other known types will return false

Reversal boolean resultโ€‹

is.not_ie() // false if the command is executed in the ie browser
is.not_ie('Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)') // false

// Alternative
isConfig.state.userAgent = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)';
is.not_ie() // false

// Recomendation
is.not_browser_ie();

is.not_ie(false) // true
is.not_ie(new Boolean(0)) // true
is.not_ie(new Boolean()) // true
is.not_ie(0) // true
is.not_ie('') // true
is.not_ie({}) // true
is.not_ie([]) // true
// And all other known types will return true