Q:

How to get a List from a List Collection? getByTitle returns empty list

So I retrieve a bunch of lists from host-web and put them into a listCollection similar to as outlined here.
Then I try to access a specific list called TestList. However, I can't access it from the listCollection using getByTitle("TestList"). It will give me a list with no information from the list I'm retrieving.
However, if I loop through an enumerator until I find a list with the title TestList, I can use that. 
Does anyone know why this doesn't work?
var testList = listCollection.getByTitle("TestList");
console.log(testList);

But this does?
var listEnumerator = listCollection.getEnumerator();

while (listEnumerator.moveNext()) {

    oList = listEnumerator.get_current();

    if (oList.get_title() == "TestList") {
        console.log(oList);
    }
}

These console.log yield the respective outputs. See how the top one doesn't have an Object inside the ClientObjectData. Why is that? What am I missing?

Thanks

A:

Using the getByTitle method from sp.js you should use like this.
SP.ListCollection.getByTitle()

NOTE: With this you will get only the list name not the array of objects.

Returns the list with the specified title from the collection.

To get the items inside the list you should use this method.
SP.List.getItems()

Returns a collection of items from the list based on the specified query

From SP.Listgetitemns docs
Instead of just:
var testList = listCollection.getByTitle("TestList");

Try 
var testList = listCollection.getByTitle("TestList");
listItemCollection = testList.getItems(""); // or use a CAMLQuery to be more specific
context.load(listItemCollection);
context.executeQueryAsync(onQuerySucceeded, onQueryFailed);

Then it should be populated and should look like the second example.

