数据结构42-链表indexOf方法实现时间:2023-02-11 10:56:14 LinkList.prototype.get = function (data) { var current = this.head; var index = 0; //开始查找 while (current) { if (current.data == data) { return index; } current = current.next; index += 1; } return -1; };