p5js Mode doesn’t seem to be compatible w/ JS ECMA 6 / 2015.
But if you prefer to code locally, here are some tips: