JavaScript JavaScript and the DOM Responding to User Interaction The Event Object

Alasdair Marchant
Alasdair Marchant
4,592 Points

What does => mean in the code?

dataset.addEventListener("click", (event) => { console.log(;

I don't quite understand what this part of the code means: =>

1 Answer

Johan Cederschiöld
Johan Cederschiöld
5,708 Points

Hi Alasdair, I agree it's a bit confusing :-) and I'm not sure if I understand your question correctly, but here goes. The => indicates that it's an arrow function (a more concise way to specify functions). It's explained in the course "Getting started with ES2015":

You can practice using it in this workshop:

Hope it helps. /Johan