Skip to content

Javascript Optional Chaining

The optional chaining (**?.**) operator accesses an object's property or calls a function. If the object accessed or function called using this operator is [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined) or [null](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null), the expression short circuits and evaluates to [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined) instead of throwing an error.

e.preventDefault() // preventing the default behaviour to refresh on submit

ModelMapper in SpringBoot

On this page

No Headings