Qualcomm interview question

JavaScript fundamental Reverse linked list and print out