• Hello !

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

    1. function func(_pin)
    2. {
    3. if ( typeof (_pin)!=="Pin" /* the design code does not work */ )
    4. {
    5. /* here some code */
    6. }
    7. }
    1. function func(_pin)
    2. {
    3. if (_pin instanceof Pin)
    4. {
    5. /* here some code */
    6. }
    7. }
  • @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
    • $ Donate
About

The problem with the identification of instances of a class Pin

Posted by Avatar for Konkery @Konkery

Actions