Skip to content

Instantly share code, notes, and snippets.

@lukyth
Created March 4, 2016 07:44
Show Gist options
  • Select an option

  • Save lukyth/014f844d7f35b5eaf0bd to your computer and use it in GitHub Desktop.

Select an option

Save lukyth/014f844d7f35b5eaf0bd to your computer and use it in GitHub Desktop.

Revisions

  1. lukyth created this gist Mar 4, 2016.
    12 changes: 12 additions & 0 deletions gihub-feed-type.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    var feed = document.querySelectorAll('.alert')
    var feedType = {}
    feed.forEach(function(el){
    (el.classList).forEach(function(className){
    if (feedType[className]) {
    feedType[className] += 1
    } else {
    feedType[className] = 1
    }
    })
    })
    console.log(feedType)