score:0

abhinav you are passing items as props in entries and when you do map on an array there is a callback function which is createtask.

createtasks(itemmm) {
    return <li key={itemmm.key}>{itemmm.text}</li>;
 }

the above function is callback of map method of code below

this.props.entries.map(createtasks);

it is the same thing which i specify below.

this.props.entries.map((itemmm)=>{
  return <li key={itemmm.key}>{itemmm.text}</li>;
});

score:1

1.understanding "itemmm" is a vague object

createtasks(itemmm) {
    return <li key={itemmm.key}>{itemmm.text}</li>;
  }

edit: regarding key and text

var newitem = {
        text: this._inputelement.value,
        key: date.now()
      };

      this.setstate(prevstate => {
        return {
          items: prevstate.items.concat(newitem)
        };
      });

the logic starts from here.

you get items as [{key:23213123, text:'xyz'}]

var listitems = this.props.entries.map(this.createtasks);

here itemmm is the parameter and you can define it with any name.

  1. items are passed into todoitems to entries as props.

Related Query

More Query from same tag