Edit in JSFiddle

var rs = document.getElementById('rs')
var ln = `\n`
var line = `\n${'#'.repeat(64)}\n`


rs.textContent += `Set to Array\n`
rs.textContent += `[...new Set([1,2,3,3,5,5,5,])]: ${[...new Set([1,2,3,3,5,5,5,])]}`
rs.textContent += line
rs.textContent += `[1,2,3,3,3,4,4,5,5,6]: ${[1,2,3,3,3,4,4,5,5,6]}`
<p>
ECMA6 에서 Set은 중복이 없는 순서있는 리스트이다.
</p>
<dl>
<dt>만들기</dt>
<dd>var set = new Set()<br/>
var set2 = new Set([1,3,5])</dd>
<dt>추가 - 문자,숫자는 구분된다.</dt>
<dd>set.add(1)<br/>
set.add("1")</dd>
<dt>존재여부</dt>
<dd>set.has(1)</dd>
<dt>삭제</dt>
<dd>set.delete(1)</dd>
<dt>크기</dt>
<dd>set.size</dd>
<dt>모두삭제</dt>
<dd>set.clear()</dd>
<dt>forEach 순회</dt>
<dd><pre>set.forEach(function(val,key, ownerSet){
  console.log('key: ', key, ', ', val:', val, ', is:', set===ownerSet)
})</pre></dd>
</dl>

<pre id="rs"></pre>