I have an array of the following:
var oldArray = [
{number: '12345', alphabet: 'abcde'},
{number: '54321', alphabet: 'abcde'},
{number: '67891', alphabet: 'abcde'},
{number: '19876', alphabet: 'abcde'},
]
And I would like to extract only the number
from the oldArray
and create a new array of them called newNumberArray
with only the strings and not as objects, like so:
var newNumberArray = [
{'12345'},
{'54321'},
{'67891'},
{'19876'},
]
How can I go about doing so?