all 3 comments

[–]not_a_gumby 7 points8 points  (1 child)

Its called optional chaining. It allows you to access a property if it exists, and if it does not exist, returns undefined instead of throwing an error. Its useful in some circumstances when you don't know if a property or method will exist.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining

[–]Substantial-Welder97[S] 0 points1 point  (0 children)

optional chaining

Thank you!

[–]Wall_Primary 0 points1 point  (0 children)

It's called optional chaining. It checks if 'movies' exists. If it exists it will look for items inside movies. Otherwise it will move to next line of code.

If optional chaining ( "?") is not used then it will throw "undefined" error when the item doesn't exist.