title: Inner join with linqJS
body: <p>I create a dateRange wich is an array of dates. </p>
  
  <p>Then I have an array of day numbers like 0 for Sunday, 1 for Monday etc...</p>
  
  <p>Now I want to get all dateRange dates according to the visibleWeekDays array.</p>
  
  <p>The solution is in the getVisibleDateRange function.</p>
  
  <p>But I want to do it with LINQ because why reinvent the wheel...</p>
  
  <p>The inner or outer selector would still need a .day() because one of the selector is a momentJS object.</p>
  
  <p>But to get the day of week I would need to put the ".day()" into the linqJS string which can not work...</p>
  
  <p>What would be your solution with linqJS ?</p>
  
  <pre><code>// Arrange
  var startDate = moment(new Date(2014, 1, 1));
  var endDate = moment(new Date(2014, 1, 15));
  var visibleWeekDays = [0,1]
  
  // Act
  var dates = dateFactory.dateRange(startDate, endDate);
  
  var visibleDays = dateFactory.getVisibleDateRange(visibleWeekDays ,dates);
  
  
  
   function getVisibleDateRange(visibleWeekDays, dateRange) {
          var visibleDateRange = [];
          for (var i = 0; i &lt; dateRange.length; i++) {
              for (var j = 0; j &lt; visibleWeekDays.length; j++) {
                  var currentDate = dateRange[i];
                  var dayOfWeek = currentDate.day();
                  var visibleDayOfWeek = visibleWeekDays[j];
                  if (visibleDayOfWeek === dayOfWeek) {
                      visibleDateRange.push(currentDate);
                  }
              }
          }        
          return visibleDateRange;
      }
  
      var visibleDateRange = Enumerable.from(visibleWeekDays).join(dateRange,"","","outer,inner=&gt;outer + ':' + inner")
  </code></pre>