var ul = document.getElementById("myul");
var liNodes = [];
for (var i = 0; i < ul.childNodes.length; i++) {
if (ul.childNodes[i].nodeName == "LI") {
liNodes.push(ul.childNodes[i]);
}
}
var myUL = document.getElementById("myUL");
var list = myUL.children.tags("LI");
alert(list.length);
let arr = [1,1,1,2,2,3]
var count = new Map();
for(num in arr){
if (count.size !== 0 && count.has(arr[num])){
count = count.set(arr[num],1+ count.get(arr[num]))
}
else{
count = count.set(arr[num],1);}
/* Output
Map(3) { 1 => 3, 2 => 2, 3 => 1 }
*/