I will preface this by saying that I am not any flavor of PHP developer. I’ve spent maybe <1 month writing PHP in my very long career. But I am a very senior javascript developer, who has sat on both sides of the interview table. And I think your expectation that you would get the answer you’re seeking from a senior developer is really unreasonable.
And the reason is that when I’m interviewing with someone presented as a senior developer, I only know that that person believes himself to be a senior developer, not that I would consider him a senior developer. I also don’t know how long his career has been or what areas of focus he has had. And I have no idea what specifically is in his mind when he asks a question. So I have given many answers in my time that will seem wrong to the person sitting across from me based on their understanding, and I am ok with that.
If you asked me that question with no hints about what specific thing about arrays matters to you, I might give you an answer about how the methods on Arrays were my first introduction to functional programming, and that caused me to really grow as a developer.
If you clarified with more context about the fact you think it matters that a JavaScript array can’t be directly iterated when it’s used as an Object (as, indeed, no JavaScript Object can), I’d have responded who even directly iterates Arrays (especially ones that could potentially come back with Object keys you want to include in that iteration), when there’s _.forEach?
That’s actually an interesting moment for me as an interviewee, when it happens. Will the interviewer be willing to adjust his frame of reference, grow, and learn? Will he obviously mentally dismiss my point? Will he just move on with no visible reaction? Will he tell me that now there’s ES6, there’s no need for lodash?
And what you do as an interviewer when you don’t know as much about the question as the interviewee can really affect your early relationship with her, should a hire occur. So be a bit careful with these kinds of questions.