r/webdev • • Apr 07 '23

How I interview for FE positions

Post image
4.6k Upvotes

668 comments sorted by

View all comments

Show parent comments

1

u/notislant Apr 07 '23 edited Apr 07 '23

Honestly the arrow vs regular functions threw me off. Looked it up and they dont take parameters, just from the scope? But I would assume if you declared it as:

const pointyGuy = (params) => {} then its just taking parameters like a normal function once declared to my knowledge?

8

u/doctorMiami1337 Apr 07 '23

The first thing that would come to mind regarding this question imo is the different behaviour of an arrow function vs a regular function in like a class and the behaviour of the this keyword inside them

What else would you even talk about there?

2

u/vklepov Apr 07 '23

In fact, the only answer I wouldn't like is "I always use arrow because function is bad"

5

u/Noch_ein_Kamel Apr 07 '23

It's just the scope really and that you can omit the "return" for simple stuff