Problem
Create a Lightning Web Component (LWC) to display a list.
The component needs to display list of records from a public array variable called "names".
Complete the provided practice example to display records in the lwc component.
Instructions
- The names is an arrary of strings and a public variable (@api) declared in the javascript file.
- Each record in names array represents a person's name.
- The lwc component must display individual names inside a paragraph tag (<p>) using lwc data binding.
Sample output
Note : This exercise introduces you to writing a simple LWC component that dynamically shows fields based on a javascript variable. Focus on meeting the requirements, and feel free to validate your code using the execute button.
Refer to the official LWC documentation link for more details on conditional rendering in LWC.
To learn more about lightning web components, click here to visit the lightning web components developers guide