you can do 

`$('.site-message').addClass('site-message--' + this.type + ' site-message--' +  this.id);`

though your way is more readable