what is the goal of checking whether it is an array or no, while the logic is the same (i.e. returning the value)