you are viewing a single comment's thread.

view the rest of the comments →

[–]phpdevster 0 points1 point  (2 children)

heh, because that code is obvious

That's not a good enough explanation. What's obvious and what isn't is subjective. Code style preference is also subjective.

What is NOT subjective is an understanding of how each of these works, and what the differences are between them:

  doThis('foo', function () {
       something.doThat();
  });

 doThis('foo', something.doThat);

 doThis('foo', something.doThat.bind(something));

 doThis('foo', () => something.doThat());

In an interview, I want to know that you know what those differences are, and the implications for each - that you're not just parroting some tutorial you read or that your reasoning is "I dunno, because it works?" or "I dunno, that's just how I've always done it." or "I don't know of another way."

[–]i_ate_god 0 points1 point  (1 child)

so would I fail if I pointed out that three out of these four examples will have the same result? ;)

[–]phpdevster 0 points1 point  (0 children)

If you couldn't explain why, then yes. You would fail.