---
title: "Comment by Tommy Hodgins on \"Functional JavaScript: How to use array reduce for more than just numbers\" | Hashnode"
description: "The most common thing I use reduce() for is producing Strings as output, by looping over and processing a list of some kind of data. I might be doing something"
url: "https://hashnode.com/posts/functional-javascript-how-to-use-array-reduce-for-more-than-just-numbers/5ce546b532b49d9b601220e7/comment/5ceaf78f8e78b4f14b372f09"
---

[Discussion](https://hashnode.com/posts/functional-javascript-how-to-use-array-reduce-for-more-than-just-numbers/5ce546b532b49d9b601220e7)

Comment [Functional JavaScript: How to use array reduce for more than just numbers](https://hashnode.com/posts/functional-javascript-how-to-use-array-reduce-for-more-than-just-numbers/5ce546b532b49d9b601220e7)

[Tommy Hodgins](https://hashnode.com/@tomhodgins)

[May 26, 2019](https://hashnode.com/posts/functional-javascript-how-to-use-array-reduce-for-more-than-just-numbers/5ce546b532b49d9b601220e7/comment/5ceaf78f8e78b4f14b372f09)

The most common thing I use `reduce()` for is producing Strings as output, by looping over and processing a list of some kind of data. I might be doing something like:

-   reducing an `Array` of data into a String of HTML source
-   reducing a `NodeList` of elements (like what gets returned from `document.querySelectorAll()`) in a webpage into a String of CSS source
-   reducing a `CSSStyleSheet` into a String of CSS source
-   reducing an `Array` of data into other formats (CSV, MD, TXT, JSON, JS, etc) and sometimes also outtputting that as data URIs

I think the only time I've used it on numbers has been as a demo summing an `Array` of numbers to show what it can do, not for anything I've actually needed yet :D
