Code is not executed in Processing, but in p5.js Web Editor

Thank you for the answer. Yes I thought so too, that is why I packed the function into the preload(). Unfortunately that didn’t change anything either. Is there a way to execute the exact: deviceList[1].id only once it exists?