Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
bobbylarrybobby
· 5y ago · 0 comments
Won't the arrow function not bind `this` to the DOM element, causing it to refer to the window object? I think you have to use a real `function`, `function(){this.remove()}`
Comments
[–]
deniz-a
5y ago
Arrow functions have the same `this` as the scope where they are declared (in this case, an onclick attribute). Both would work in this case.