0

Below data is printed in console.log , How can i print header from this array i tried below approach but i got error map is not a function, So this is server side nodejs , How can i get headers object from data ?

server.js

console.log(data);

var result = data.map(function(a) {return a.fieldName;});

    { file:
       [ { fieldName: 'file',
           originalFilename: 'sco_poc.bpmn',
           path: 'yGCNPv.bpmn',
           headers: [Object],
           size: 11078 } ] }
0

2 Answers 2

4
console.log(data.file[0].headers);

try this

OR This

var result = data.file.map(function(a) {
       console.log(a.headers);
        return a.headers;
 });
Sign up to request clarification or add additional context in comments.

Comments

0

You can solve above problem also using Lodash.

Here is an example:

 var result = _.map(data.file,function(value){
    return value.headers;
 });

 console.log(result);

jsfiddle

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.