how to check if a message has an attachment discord js

JavaScript
if (message. attachments. size > 0) {
  //DO STUFF
}
Source

Also in JavaScript: