title: making function to access object properties
body: <p>I am trying to write a common function to access object properties as parameters, but i keep getting "undefined". here is my code</p>
  
  <pre><code>var users = [{
    "id": 1,
    "first_name": "Fredelia",
    "last_name": "Tanman",
    "email": "ftanman0@home.pl",
    "gender": "Female"
  }, {
    "id": 2,
    "first_name": "Sigmund",
    "last_name": "Maryska",
    "email": "smaryska1@com.com",
    "gender": "Male"
  }, {
    "id": 3,
    "first_name": "Axel",
    "last_name": "Stangoe",
    "email": "astangoe2@edublogs.org",
    "gender": "Male"
  }, {
    "id": 4,
    "first_name": "Mariana",
    "last_name": "Danneil",
    "email": "mdanneil3@comsenz.com",
    "gender": "Female"
  }, {
    "id": 5,
    "first_name": "Kira",
    "last_name": "Papps",
    "email": "kpapps4@oracle.com",
    "gender": "Female"
  }]
  
  function getProp(prop){
        return users.map(function(person){
          return person.prop; 
        })
      }
  </code></pre>
  
  <p><a href="https://jsbin.com/mirahavavi/edit?js,console" rel="nofollow noreferrer">https://jsbin.com/mirahavavi/edit?js,console</a></p>