<a href="#">Скрыть дубли</a>
<ul id="list">
<li id="item1" class="clone" style="display: block;">01</li>
<li id="item2" class="clone" style="display: none;">02</li>
<li id="item3" class="clone" style="display: block;">03</li>
<li id="item4" class="box" style="display: block;">04</li>
<li id="item5" class="box" style="display: none;">05</li>
<li id="item6" class="box" style="display: none;">06</li>
<li id="item7" class="box" style="display: block;">07</li>
</ul>
<script>
document.querySelector('a').onclick = e =>{
var arr = [];
document.querySelectorAll('#list li').forEach(el=>(!arr.includes(el.className) && el.style.display !== 'none')?arr.push(el.className):el.style.display = 'none');
};
</script>