In line 49, you are checking for a position that contains an element, so I guess you would like to break the while loop if there is no value for that position
so
while (table[index] === undefined || table[index].key !== key)
should be
while (table[index] !== undefined || table[index].key !== key)