• Hello !

    Tell me how to check the passed argument belonging to a class "Pin" ?

    function func(_pin)
    {
        if ( typeof (_pin)!=="Pin" /* the design code does not work */ )
        {
            /* here some code */
        }
    }
    
  • function func(_pin)
    {
        if (_pin instanceof Pin)
        {
            /* here some code */
        }
    }
    
  • @Konkery you don't have an official Espruino board - please don't post in the 'Official Boards' section.

    It exists so I can help people who have purchased boards that actually contribute something to Espruino. I do still look at the other forums, just not as often.

  • Ок

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

The problem with the identification of instances of a class Pin

Posted by Avatar for Konkery @Konkery

Actions