0

How do I return the values of the key "name"? Want to just return: {test, test2}

var p = [{
    comment: "false",
    comments_text: "",
    like: 0,
    name: "test"}, 
 {
    comment: "false",
    comments_text: "",
    like: 0,
    name: "test2"  
    }]

I tried the following as a starting point, but it's not returning any keys whatsoever:

function tester(p){
  return Object.keys(p[name])
}
Alex
  • 249
  • 3
  • 12

0 Answers0