Deriving a new Array from an existing Array:
['■','●','▲'].slice(1, 3) ⟼ ['●','▲']
['■','●','■'].filter(x => x==='■') ⟼ ['■','■']
['▲','●'].map(x => x+x) ⟼ ['▲▲','●●']
['▲','●'].flatMap(x => [x,x]) ⟼ ['▲','▲','●','●']
<?php | |
// Change the columns for the releases list screen | |
function change_columns( $cols ) { | |
$cols = array( | |
'cb' => '<input type="checkbox" />', | |
'featimg' => 'Featured Image', | |
'excerpt' => 'Excerpt?', | |
'title' => 'Title', | |
'artist' => 'Artist', | |
'catno' => 'Cat#', |