LWC component does not allow us to perform expressions in an HTML file so if we want to achieve any expressions in an HTML file in this case we can complete the expression in our getter in a .js file and then we can use that getter in our HTML file.
- Getter executes after our constructor and ConectedCallback.
- We need to use the “get” keyword before the function to make a getter function.
- If the value which we have used in the getter is changed the getter always re-evaluates the value and shows the result accordingly.
Example:-