title: Why did splice delete only last element and don't work by key?
body: <pre><code>deleteProtoItem = (protoKey) =&gt; {
          return e =&gt; {
              if (!isUndefined(e)) {
                  e.preventDefault();
              }
              const {protocol} = this.state;
              modalConfirm(`&lt;div&gt;Вы уверены что хотите удалить эту строку?&lt;/div&gt;`, {
                  cancel: "Не удалять",
                  ok: "Удалить"
              }).then(() =&gt; {
                  protocol.tasks.splice(protoKey, 1);
                  this.setState({protocol}, () =&gt; {
                  });
              }).catch(handleErrorResponse);
          };
      };
  </code></pre>
  
  <p>When I delete element don't mind what key number it have 0 or 3, anyway splice remove only last element.</p>
  
  <p>Protocol.tasks array</p>
  
  <p><a href="https://i.stack.imgur.com/MoIwZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MoIwZ.png" alt="x"></a></p>