DEV Community

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 Wicaksono

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