Based on your input data being an array of objects, with properties representing the columns, you can use the
map
method to extract the values of a single column:
const input = [
{
"Col1": "abc",
"Col2": "pqr",
"Col3": "xyx",
"Col4": "aaa",
"Col5": "bbb",
"Col6": "ccc",
"Col7": "ddd"
},
{
"Col1": "aaa",
"Col2": "bbb",
"Col3": "ccc",
"Col4": "ddd",
"Col5": "eee",
"Col6": "fff",
"Col7": "ggg"
}
];
const columnName = "Col3";
const output = input.map(x => x[columnName]);
Demo - JSFiddle[
^]
Array.prototype.map() - JavaScript | MDN[
^]