💾functionDefinition()

JSvaluescustom functions ⟩ functionDefinition()

// ⭐️ content of function definition (string)
function functionDefinition(value) {
    
    // ---------------------------------------------------------------------
    // ⭐️ will throw a TypeError if value is not a function:
    //   ⛔ TypeError: 
    //      Function.prototype.toString requires that 'this' be a Function
    // ---------------------------------------------------------------------
    
    return Function.prototype.toString.call(value);
}

💈範例:👉 isClass()

Last updated