The variable i have:
var array = [['test1', 0], ['test2', 3], ['test4', 45]]
So i need some type of flatten but just for the first values of every array, the output should be:
['test1', 'test2', 'test4']
The variable i have:
var array = [['test1', 0], ['test2', 3], ['test4', 45]]
So i need some type of flatten but just for the first values of every array, the output should be:
['test1', 'test2', 'test4']
Try using Array.map https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
var array = [['test1', 0], ['test2', 3], ['test4', 45]]
var arrayMapd = array.map(item => item[0])