79471661

Date: 2025-02-27 05:22:24
Score: 0.5
Natty:
Report link
const arrayColumn = (array, column_key, index_key = null) => {
    if (index_key !== null) {
       return array.reduce((a, b) => Object.assign(a, {[b[index_key ]]: column_key ? b[column_key] : b}))
    } else {
       return array.map(a => column_key ? a[column_key] : a)
    }
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Andrey Chesnakov