You are reading a single comment by @AkosLukacs and its replies. Click here to read the full conversation.
  • If you know what type you expect, you can use instanceOf. For example:

    if (!(serialPort instanceof Serial)) {throw '"serialPort" parameter is not a serial port!'}
    if (!(rxPin instanceof Pin)) {throw '"rx" parameter is not a Pin!';}
    
About

Avatar for AkosLukacs @AkosLukacs started