Deqing, sorry I updated my comment but seems you miss it, posted again.

```
// check validation of callback for addEventListener way
if (!isOnChange && (typeof callback !== 'function')) {
  console.log("Invalid parameters of callback!");
  return -1;
}

// check validation of callback for oncontactschanged way, it can be null or a function
if (isOnChange && (callback !== null || (typeof callback !== 'function'))) {
  console.log("Invalid parameters of callback!");
  return -1;
}
```