Say you have a dictionary that you want to both copy and update. In JavaScript, this is a common pattern that gets its own syntax, called the object spread operator:

const oldObject = { hello: 'world', foo: 'bar' }
const newObject = { ...oldObject, foo: 'baz' }

After running this snippet, newObject will be an updated copy of oldObject{ hello: 'world', foo: 'baz' }. Turns out, you can also do this in Python since 3.5:

old_dict = {'hello': 'world', 'foo': 'bar'}
new_dict = {**old_dict, 'foo': 'baz'}

In JavaScript, you can also use spread operators in arrays to make updated copies:

const oldArray = [1, 2, 3]
const newArray = [...oldArray, 4, 5]

This would make newArray an updated copy with [ 1, 2, 3, 4, 5 ].

We can replicate the behavior for lists in Python:

old_list = [1, 2, 3]
new_list = [*old_list, 4, 5]

This is less useful since you can also write old_list + [4, 5], which does not exist in JavaScript. But the spread operator approach (apparently called splatting in Python) is still a cool trick to know.