No, this is not the only purpose of the interview. The purpose is to check if you know JavaScript and var are super basic. I can not imagine a JavaScript developer that does not know what is var, that being said-it is very legitimate to ask about it and to ask if you would use it in 2022.