Looking at your previous posts it seems like it might be an ESP8266? Getting UDP on those requires actual firmware changes - @ClearMemory041063's code will only work when run on an Espruino board that is connected to an ESP8266.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
What board are you using this on?
Looking at your previous posts it seems like it might be an ESP8266? Getting UDP on those requires actual firmware changes - @ClearMemory041063's code will only work when run on an Espruino board that is connected to an ESP8266.