๐Ÿ’พfunctionDefinition()

JS โŸฉ values โŸฉ custom functions โŸฉ functionDefinition()

  • replit๏ผšisClass()

  • (to use it, copy and paste from ๐Ÿ“ module file๏ผš typeName())

// โญ๏ธ 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

Was this helpful?