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