how to replace an object in arraylist in javascript code example Example: arraylist replace listName.set(index, value);