How to select a layer?

This might be a stupid question but once again, the API documentation wasn’t very helpful (or it was too hidden away to find). How can I select a layer (or layer group) - make it active - by its variable reference?

In CEP it was simple … docRef.activeLayer = layer1;

I tried “docRef.activeLayers[0] = layer1” or “docRef.activeLayers = [layer1]”, but that didn’t work.