Try something like this:
if (typeof me.onChange !== "undefined") {
// safe to use the function
}
or better yet (as per UpTheCreek upvoted comment)
if (typeof me.onChange === "function") {
// safe to use the function
}
More Related Contents:
- Formula to find week numbers from the Total [closed]
- How to filter object array based on attributes?
- Suppress Chrome ‘Failed to load resource’ messages in console
- How to take screenshot of a div with JavaScript?
- How to do associative array/hashing in JavaScript
- Understanding prototypal inheritance in JavaScript
- Template literal inside of the RegEx
- Nodemailer with Gmail and NodeJS
- Normalizing mousewheel speed across browsers
- ‘this’ does not work properly in another event. I’m clueless as to why [duplicate]
- How to upload preview image before upload through JavaScript
- JavaScript – get array element fulfilling a condition
- SCRIPT438: Object doesn’t support property or method IE
- Integrating Dropzone.js into existing HTML form with other fields
- What do the brackets around the arguments mean when reading documentation for a method? [duplicate]
- Generic way to detect if html form is edited
- JavaScript loop performance – Why is to decrement the iterator toward 0 faster than incrementing
- How do we or can we use node modules via npm with Meteor?
- Passing arguments to angularjs filters
- How to dynamically set a function/object name in Javascript as it is displayed in Chrome
- Click events on Pie Charts in Chart.js
- Github – unexpected disconnect while reading sideband packet
- JavaScript Dynamic Variable Names
- keep placeholder on focus in IE10
- Methods vs Computed in Vue
- How to show hidden divs on mouseover?
- Using jQuery inArray with array of JavaScript Objects
- how to schedule ajax calls every N seconds?
- What is the meaning of “foo(…arg)” (three dots in a function call)?
- Is possible to save JavaScript variable as file? [duplicate]