Make check inventory a little bit more efficient.
Adding some jsDoc