Skip to content

Instantly share code, notes, and snippets.

@diegocasmo
Last active November 17, 2016 20:01
Show Gist options
  • Save diegocasmo/017da4fb582eef4ceaad94991359e197 to your computer and use it in GitHub Desktop.
Save diegocasmo/017da4fb582eef4ceaad94991359e197 to your computer and use it in GitHub Desktop.
upwork_count_work_diary_slots_by_task.js
var elements = document.getElementsByClassName('o-activity');
var elementsArr = [];
for(var i = 0; i < elements.length; i++)
{
elementsArr.push(elements.item(i).text);
}
var uniqueCount = {};
elementsArr.forEach(function(i) {
uniqueCount[i] = (uniqueCount[i]||0)+1;
});
console.log(uniqueCount);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment