JS Periksa apakah fungsi tersedia dalam lingkup

if (typeof me.onChange === "function") { 
    // safe to use the function
}
Eager Elephant