LinkedList functionality in GAS (Google Apps Script)