myRide = new Car("BMW");
letsDrive = myRide.drive;
letsDrive(); // alerts "You are driving a undefined"
The 'this' pointer refers to the object on which you wrote the 'dot' to invoke the function. If you wrote a.b(), then inside b() 'this' will be 'a'. In your example, you used a function pointer directly without the 'dot' and got undefined. That is not a bug or a "mine", that's how JS works.From the last article (why CoffeeScript isn't the answer) in the series:
eat food for food in foods when food isn't 'chocolate'
> The declaration of what food is occurs in the middle of the line and doesn’t even look like a variable declaration. That code could easily be worse if "unless eat is undefined" was added to the end, making the whole line conditional.You'd probably have issues with Python too for it's comprehensions. You should see beyond elementary syntax if you want to make arguments about languages. These details aren't even a preference; you get used to it in no time.
Summary for people jumping into JS from other languages, buy some good books because JS is somewhat different. Also, the "minefield" isn't that big a deal in practice.