Background
Let’s look at the following piece of code (in an abstract programming language) :
if chairs {
for chair in chairs {
clean(chair)
}
}
The Problem
It’s more code that we would like to have. What’s holding us back? chairs can be null, which is not an array (aka list), therefore requiring the wrapping if. Without that if, for can fail with an error because it won’t be able to iterate over chairs (when it’s null).
Side note: any time a variable can be of different types (in our case chairs can be an array or null), there will be some code to deal with this situation. Try to avoid these situations.
Solution

Decide on a code convention that says that absence of items is represented by an empty array, not null. Your code will become more uniform and you will get rid of the if. Then the code above becomes:
for chair in chairs {
clean(chair)
}
Please note that this solution is a tradeoff. If memory usage is very important in the application, this might not be a good solution.
Hope this helps. Have a nice day!
Update 2023-07-13
Real code example:
const tags = describeImagesCommandOutput.Images[0].Tags ?? [];
console.log('tags', tags);
const newTags = tags.filter(tag => tag.Key && TAGS_TO_COPY.has(tag.Key));
console.log('newTags', newTags);
My advice above would eliminate the ?? [] part.