DEV Community


Discussion on: Applying To Facebook

miketalbot profile image
Mike Talbot

Another great article. I think a lot of things like IIFEs, call and apply have more modern equivalents these days. When I read your article I looked through my main code base for where I use them and they are there, but in deep and more esoteric parts of the system where I am using them to handle attaching mixins that need to share a common this. They are deliberately there to stop developers needing to worry about stuff and never appear in anything apart from libraries. Back in the day I'd have been using IIFEs to capture loop variables for closures or making "private properties" for a class and .apply() was always for fn(...thosePeskyParameters)

bytebodger profile image
Adam Nathaniel Davis Author

Well said! It's not that I think those tools are pointless. I'm just not sure that they're particularly useful in "modern" stuff. And yeah... I understand that an employer may be asking about these things because large parts of their codebase are not modern. But you can be a pretty dang good dev without being knowledgeable about .call()/.apply().

Specifically, since I switched to fully-functional React w/Hooks, it's been more than a year since I even used this. And without this, there are a lotta ways to do the same things that you do with .bind()/.call()/.apply() - without using .bind()/.call()/.apply()

Forem Open with the Forem app