The JavaScript Minefield

go javascript programming

Will Faught

1 minute

Jeff Walker:

How is JavaScript a minefield? Well, JavaScript has all sorts of pitfalls lurking for the developer. Each pitfall is like a mine in the minefield, silently waiting for you to accidentally step on it. Just like the minefield, JavaScript’s mines are hidden in plain sight. Entire books have been written about all the mines present in JavaScript. Maybe I’ll get into what some of those are in future blog posts. Now, if you are going to venture into a minefield, you need a way to avoid stepping on a mine. You need either a safe path through the minefield or a detailed map of all the mine locations.

It’s interesting how two of his solutions, explicit this parameters and explicit object literal inheritance, are very similar to Golang’s method receiver parameters and struct embedding.

π