check if function was defined wpf c# code example Example: check if function exists javascript if (typeof payment === "function") { // Do something }