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