javascript - Check if browser supports MutationObserver -


how 1 write if clause check see if mutationobserver supported?

try using in operator

the in operator returns true if specified property in specified object.

syntax

prop in objectname

parameters

prop

a string or symbol representing property name or array index (non-symbols coerced strings).

objectname

name of object.

if ("mutationobserver" in window) {   // stuff } 

Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -