how do I get an object's tag and store it in a variable?

I have a few pickups in my game, and based on what their Tag is, they do different things. So I want to create a switch function with all the cases.
My (very basic) problem, is that I can’t seem to be able to find a way in the script (that is attached to the pickup) to store that Tag in a variable so I can write the switch function to check what tag it has…

I am a designer getting into code, so please bare with me if this is a silly question, which I’m sure it is. I’m writing in Javascript by the way.

Thanks
Y

I think this will do. Or similar, don’t usually do javascript.

OnCollisonEnter(other : Collider){

   var otherTag : string
   otherTag = other.tag;

   switch( otherTag )
   {
      case: "player"{
      }
      case: "anothertag"{
      }
      case: "yetanothertag"{
      }
      default:
      {
      }

}