I am new to Shopify and have just started learning it. I was going through the docs and I found out that there is a 'collection' object that has many useful properties inside it like products, sort_options etc. As I was looking into the source code of my theme, I found many occurrences of this 'collection' object but I could not find the file in which this object is defined. So my question is that can we edit this 'collection object' and if yes then how?
Just as an example, suppose if I want to add a sort option, my first instinct was to add a string on collection.sort_options array but where is this array defined?