title: how can I use includes() function on nested arrays?
body: <p>I have an array like this:</p>
  
  <pre><code>var arr = [];
  arr = [['red', 685], ['green', 210], ['blue', 65]];
  </code></pre>
  
  <p>Also I have two variables:</p>
  
  <pre><code>var color  = 'blue';
  var number = 21;
  </code></pre>
  
  <p>All I'm trying to do is checking the first item of each nested array of <code>arr</code> and then either update the second item of it or make a new array for it.</p>
  
  <p>Here is some examples:</p>
  
  <p><strong>Input:</strong></p>
  
  <pre><code>var color  = 'blue';
  var number = 21;
  </code></pre>
  
  <p><strong>Expected output:</strong></p>
  
  <pre><code>arr = [['red', 685], ['green', 210], ['blue', 21]];
  </code></pre>
  
  <hr>
  
  <p><strong>Input:</strong></p>
  
  <pre><code>var color  = 'yellow';
  var number = 245;
  </code></pre>
  
  <p><strong>Expected output:</strong></p>
  
  <pre><code>arr = [['red', 685], ['green', 210], ['blue', 21], ['yellow', 245]];
  </code></pre>
  
  <hr>
  
  <p>Here is what I've tried so far:</p>
  
  <pre><code>if ( !arr.includes(color) ) {
      arr.push([color, number]);
  } else {
      arr[color] = time;
  }
  </code></pre>
  
  <p>But <code>!arr.includes(color)</code> condition is wrong. Because each item of <code>arr</code> is also an array. Anyway, how can I use <code>includes()</code> function on the first item of nested arrays?</p>