JanetDocsPlaygroundI'm feeling luckyGitHub sign in

frequencies



    function
    boot.janet on line 1572, column 1

    (frequencies ind)

    Get the number of occurrences of each value in an indexed data 
    structure.


1 exampleSign in to add an example
Loading...
(frequencies ["a" "a" "b" "c" "d" "d"])
# => @{"c" 1 "d" 2 "a" 2 "b" 1}


(frequencies {:a "Bob"
              :b "Joe"
              :c "Mat"
              :d "Bob"})
# => @{"Bob" 2 "Joe" 1 "Mat" 1}

(frequencies "Hallo World")
# => @{108 3 114 1 100 1 87 1 97 1 32 1 111 2 72 1}
leobmPlayground