title: Pass array to function or make sure it is within scope?
body: <p>I am trying to sort an array using an onclick function, and I'm getting the error obj is not defined. Maybe it's not within the scope?</p>
  
  <p>js file:</p>
  
  <pre><code>function pageLoad() {
      var url = API_URL + "/api/Ticket/GetTickets";
      var data = Ajax.getData(url);
      var obj = [];
      var tickets = JSON.parse(data.JsonResult);
      obj.Tickets = tickets;
      Tickets.Data = obj;
  
      var viewModel = {
          theObject: [obj.Tickets]
      };
      ko.applyBindings(viewModel);
  }
  function SortColumn(column) {
      obj.Tickets.column.sort();
  }
  </code></pre>