js call if exists code example Example: check if function exists javascript if (typeof payment === "function") { // Do something }