title: use filter to return property values in an object
body: <p>Trying to make a function that uses filter but not a for or while loop or foreach function, that will loop through an array of objects only to return their property values. For example, </p>
  
  <pre class="lang-js prettyprint-override"><code>function getShortMessages(messages) {
      return messages.filter(function(obj){
          return obj.message
      });
  }
  </code></pre>
  
  <p>so if I call </p>
  
  <pre class="lang-js prettyprint-override"><code>getShortMessages([{message:"bleh"},{message:"blah"}]); 
  </code></pre>
  
  <p>I should get a return of an array = ["bleh","blah"] 
  I'm just not sure how to implement filter under these guidelines. Also I was thinking of using a chain function maybe .map.</p>
  
  <p>//// Here is the entire code challenge specification/////</p>
  
  <p>Basic: Filter
   Exercise 4 of 18</p>
  
  <h1>Task</h1>
  
  <p>Use Array#filter to write a function called getShortMessages.</p>
  
  <p>getShortMessages takes an array of objects with '.message' properties and returns an array of messages that are less than &lt; 50 characters long.</p>
  
  <p>The function should return an array containing the messages themselves, without their containing object.</p>
  
  <h2>Arguments</h2>
  
  <ul>
  <li>messages: an Array of 10 to 100 random objects that look something like this:</li>
  </ul>
  
  <pre><code>{
      message: 'Esse id amet quis eu esse aute officia ipsum.' // random
  }
  </code></pre>
  
  <h2>Conditions</h2>
  
  <ul>
  <li>Do not use any for/while loops or Array#forEach.</li>
  <li>Do not create any unnecessary functions e.g. helpers.</li>
  </ul>
  
  <h2>Hint</h2>
  
  <ul>
  <li>Try chaining some Array methods!</li>
  </ul>
  
  <h2>Example</h2>
  
  <pre><code>[ 'Tempor quis esse consequat sunt ea eiusmod.',
    'Id culpa ad proident ad nulla laborum incididunt.',
    'Ullamco in ea et ad anim anim ullamco est.',
    'Est ut irure irure nisi.' ]
  </code></pre>
  
  <h2>Resources</h2>
  
  <ul>
  <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter" rel="noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter</a></li>
  <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map" rel="noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map</a></li>
  </ul>
  
  <h2>Boilerplate</h2>
  
  <pre><code>function getShortMessages(messages) {
    // SOLUTION GOES HERE
  }
  
  module.exports = getShortMessages
  </code></pre>
  
  <p>» To print these instructions again, run: functional-javascript print
   » To execute your program in a test environment, run: functional-javascript run program.js
   » To verify your program, run: functional-javascript verify program.js
   » For help run: functional-javascript help</p>