DEV Community

Discussion on: Useful features of ECMAScript 2019 reviewed

Collapse
 
rudolfolah profile image
Rudolf Olah

If you're dealing with tree structures, like in a nested JSON data object, you may want to select deeply nested items across multiple sub-structures and then use flat() to flatten the array. An example in Ruby is flattening a list of data attributes from a database request. If you're using es2019 on the backend with node.js, flat() could be useful in that case.