DEV Community

loading...

Discussion on: Day 22 of JavaScriptmas - Extract Matrix Column Solution

Collapse
alfredosalzillo profile image
Alfredo Salzillo 🐺
const extractMatrixColumn = (matrix, index) =>  {
    return matrix.map(({ [index]: value }) => value);
}
Enter fullscreen mode Exit fullscreen mode
Collapse
flyingduck92 profile image
Sekti Author

Good one mate, you combine .map with destructuring assignment 👍