To be dynamic means to always be changing. A person who moves around a lot, is loud, or changes themselves frequently is a dynamic person. The opposite of this is to be static, or unchanging. A static person doesn’t move around much and is quiet.
In programming, when we talk about static things, we generally mean that the input is set. A simple web page is static because the code doesn’t change. An example of a static site is the portfolio project.
Dynamic code means that it has to change based on the input. It’s always changing, and two people may not even see the exact same output. An example of a dynamic app is the weather app. What you see depends on your location.
in this case, the app is a ToDo list. Each user will have a different list of things they need to do, so in order to display the items, the code needs to dynamically generate a list.
const items = this.state.toDoList.map(function(item,index){
return <li key={index}> {item} </li> // each item in the todo list will be put into a <li> element
}).sort(()=>(parseInt(Math.random()-1)))
thanks for your patient reply.I think the “map” function dynamically generate a list.But now.the test is passed.I don’t know what happened.I think it was my feedback that was answered.
Hi, I have written this using arrow function but why it is not passing the test.
Here is my code, the code is working fine and producing output const items = this.state.toDoList.map((key) => <li>{key}</li>);