Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

console.table in js without index column

const array = [{myId: 42, name: 'John', color: 'red'}, {myId: 1337, name: 'Jane', color: 'blue'}]

const transformed = array.reduce((acc, {myId, ...x}) => { acc[myId] = x; return acc}, {})

console.table(transformed)
 Run code snippet
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #index #column
ADD COMMENT
Topic
Name
9+9 =