Greatly appreciate your effort for creating this list. It allowed me to get a stronger grasp on the language.
I would like to mention that during my research of these methods you've brought to all of our attention, I found that the flat() method takes an argument for the depth, so while you are correct that myArr.flat() will default to a depth of one, it's also possible to specify larger values, and even include an infinite option.
For example (stolen directly from the MDN web docs):
Greatly appreciate your effort for creating this list. It allowed me to get a stronger grasp on the language.
I would like to mention that during my research of these methods you've brought to all of our attention, I found that the
flat()method takes an argument for the depth, so while you are correct thatmyArr.flat()will default to a depth of one, it's also possible to specify larger values, and even include an infinite option.For example (stolen directly from the MDN web docs):