{"version":"1.0","type":"rich","title":"counting things in javascript","description":"A short JavaScript snippet counts word frequencies from a fixed string of text, using the array `reduce` method to tally occurrences and building a plain object that maps each word to its count. The example demonstrates a minimal functional programming pattern for aggregating categorical data, with the source data being a literal sentence split into an array of words. The output is logged to the console, showing a frequency distribution where repeated words like “pease” and “porridge” appear with higher counts than unique terms. No external libraries are used; the code relies solely on native JavaScript array and object methods.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-f8b4755f8fc46e1e82b0?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}