isWindow
The isWindow
function checks if a value is a window
object.
Signature
typescript
function isWindow(val: any): boolean
Parameters
val
:any
- The value to check.
Returns
boolean
- Returnstrue
if the value is awindow
object, otherwisefalse
.
Examples
typescript
import { isWindow } from 'js-utils-es/predicate';
isWindow(window); // true
isWindow(true); // false
isWindow(new Date()); // false
isWindow(() => {}); // false