Flatten Arrays in Vanilla JavaScript with Flat() and FlatMap()

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • TypeScript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • In addition to being essentially a combined "filter" and "map", it's also a "better" filter than filter itself in TypeScript in such that it narrows types much more ergonomically[0].

    In TypeScript, you might have an array of multiple types (e.g. `Array`), and use a `filter` call to only keep the `A`s. However, in many situations TypeScript can't figure this out and the resulting array type is still `Array`. However, when you just use `flatMap` to do nothing more than filtering in the same way, TypeScript can determine that the resulting type is just `Array`. It's a bit unfortunate really - `filter` is faster and more readable, but the ergonomics of `flatMap` type-wise are so much nicer! Just some interesting trivia.

    [0]: https://github.com/microsoft/TypeScript/issues/16069#issueco...

  • content

    The content behind MDN Web Docs

  • I just filed this issue on the MDN page: https://github.com/mdn/content/issues/11763

    That note is misleading.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Typescrypt: Make your life easier with decorators

    1 project | dev.to | 31 May 2024
  • Create a Responsive Navbar React Tailwind CSS TypeScript

    1 project | dev.to | 29 May 2024
  • React with Tailwind CSS Skeleton Loader Example

    2 projects | dev.to | 28 May 2024
  • 5 Most Used Array Methods in Front-End Development

    1 project | dev.to | 24 May 2024
  • Firefox Enables Screen Wake Lock API by Default – Again

    1 project | news.ycombinator.com | 20 May 2024