javascript проверява, има ли функция
//check if sayHello() function exists
if (typeof sayHello === "function") {
// This function exists
}
проверете дали има javascript
if (typeof payment === "function")
{
// Do something
}
js проверява, има ли функция
if (typeof yourFunctionName == 'function') {
yourFunctionName();
}
Проверете дали има функция
const obj = {first: function() {console.log("ssss"); return "returns"} };
console.log(_.result(obj, "first"));
/*note that _.result() returns a value, so if your function doesn't return anything _.result() will return undefined*/