Create a lookup object from a given array and key.