[JS] simplify var handling - var_exist should only lookup an object according to key