The String prototype’s replace function only replaces the first occurrence of a substring by default. We can extend that with a global flag on the expression.
The optional-chaining operator
We can get nested values from objects by chaining their keys. We run into an error when we try to get a value from something that does not exist. With optional chaining, these calls return
undefined instead of throwing errors.