Let’s now populate newArrayBuffer. To add an element to an ArrayBuffer you use the assignment operator += which appends the specified element to the end of an ArrayBuffer.
To add a single item, we can use the add() method. To add multiple items, we’d have to use update().
The input for update() must be another set, list, tuple, or string.
Let’s add elements to an empty set: