JSFiddle - React, Tailwind, and code Playground

by Dmitry Morar

HTML

<button type='button' id='youTube' data-color = "white"  data-background-color = "#FF0000" data-subscribe = 'false'>ПОДПИСАТСЯ</button>
 
<ul id="user-list"></ul>

CSS

ul{
  list-style: none;
}
#youTube{
background-color: #FF0000;
color: white;
padding: 10px 16px;
border-radius: 2px;
font-weight: 500;
border: 1px solid white;
cursor: pointer;
}

JavaScript

function dropElements(arr, func) {
  // Drop them elements.
  let index = -1;
  for (let i = 0; i < arr.length; i++) {
    if (func(arr[i])){
      index = i;
      break;
    }
  }

  return index === -1 ? [] : arr.slice(index);
}

dropElements([1, 2, 3, 4], function(n) {return n < 3; });