Error msg "Cannot read property 'indexOf' of undefined"
<p>Receiving an error msg that reads, "Cannot read property 'indexOf' of undefined". I'm getting the journey passport ID in the view, but the journey passport ID is not getting to the function. Also I'm not getting my console.logs for some strange reason. Any help would be so great!</p>

<p><strong>Here is my HTML which calls on the 'userLikes' filter:</strong><br>
(Full code at: <a href="https://github.com/cdtdesign/TCP-Express/blob/master/views/blog.html" rel="nofollow">https://github.com/cdtdesign/TCP-Express/blob/master/views/blog.html</a>)</p>

<pre><code>&lt;a class="like-button" title="Like"&gt;
                  &lt;i class="fa fa-heart {{journey.passport_id | userLikes}}"&gt;&lt;/i&gt;
                &lt;/a&gt;
                {% if user.passport_id == journey.passport_id %}
                &lt;a href="#modal-text/{{ String(journey._id) }}#update" title="Edit"&gt;
                  &lt;i class="fa fa-pencil journeyEditButton"&gt;&lt;/i&gt;
                &lt;/a&gt;
                &lt;a title="Delete"&gt;
                  &lt;i class="fa fa-close journeyDeleteButton" style="font-size:2.875rem;" data-journey-id="{{ String(journey._id) }}"&gt;&lt;/i&gt;
                &lt;/a&gt;
                {% endif %}
</code></pre>

<p><strong>Here's the JS causing the issue:</strong><br>
(Full code at: <a href="https://github.com/cdtdesign/TCP-Express/blob/master/routes/blog.js" rel="nofollow">https://github.com/cdtdesign/TCP-Express/blob/master/routes/blog.js</a>)</p>

<pre><code>if (req.user) {
    swig.setFilter('userLikes', function(journeyPassportID) {
      if (req.user.journeys_liked.indexOf(journeyPassportID) != -1) {
        return 'liked';
      }
    });
</code></pre>

<p><strong>Also, the code from my Journey model where the passport_id originates:</strong></p>

<pre><code>var journeySchema = new Schema({
    uuid: {
        type: String,
        default: uuid.v4()
    },
  travel_token: {
        type: String,
        default: randomstring.generate()
    },
  passport_id: String,
  traveler_name: String,
  title: String,
  date: Date,
  body: String,
  description_filename: String,
  header_image_filename: String,
  users_who_like: Array,
  tags: String,
    shortlink: String,
  deleted_at: String,
  created_at: {
        type: Date,
        default: Date.now
    },
  updated_at: {
        type: Date,
        default: Date.now
    }
});
</code></pre>