Let's open HelloWorldWebPart.ts again. As said before, the main program of HelloWorld web part is the render function in this file:
This function shows one way of building web part content. Instead of using any JavaScript framework or library, such as Angular, React, or Knockout, we are simply assigning the HTML value inside the inner HTML property of our web parts DOM element.
Using the special character ` (backtick operator) to start and end the string, HTML can be divided into multiple lines with ease. We have simple templating to use with our ${statement} placeholders. In the code, it puts the class names in place as well as writing a description web part property value to the page.
Note that the escape function from the lodash library is used to ensure that any JavaScript injected by this property is sanitized (and not executed) in the page. An old saying of security experts is that all user input is evil.
If you scroll...