Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

top5ipaddresses

node v8.17.0
version: 1.0.0
endpointsharetweet
var ipaddresses = ['1.2.3.5','1.2.3.4','1.2.3.5','1.2.3.4','1.2.3.5','1.2.3.4','1.2.3.5','1.2.3.5','1.2.3.5','1.2.3.5','1.2.3.5','1.2.3.5','1.2.3.6','1.2.3.6','1.2.3.6','1.2.3.6','1.2.3.7','1.2.3.7','1.2.3.7','1.2.3.7','1.2.3.7','1.2.3.7','1.2.3.8','1.2.3.9','1.2.3.10'] var counts = ipaddresses.reduce((map, ip) => { map[ip] = (map[ip] || 0) + 1 return map }, {}) var sorted = Object.keys(counts).sort((a, b) => counts[b] - counts[a]); var top5 = sorted.slice(0,5) return top5
Loading…

no comments

    sign in to comment