speed = transform.rotation * speed; explanation please?

So I was watching this guy on youtube… He used the code “speed = transform.rotation * speed” to align the rotation of the player object and the camera. You know, so wherever your pointing your camera, that’s the player’s forward.

Now when I tried this same line of code, I get the error “Operator ‘*’ cannot be used with a left hand side of type ‘UnityEngine.Quaternion’ and a right hand side of type 'float”.

Could someone please explain why this worked on him and not mine?
Btw I’m using JavaScript and he’s using C#… If the error is cause by that, could someone please translate that line of code to a JavaScript version.

I know this sounds confusing af, but I’m desperate for answers…

are you sure it’s just “speed = transform.rotation * speed” and not something like “speed = transform.rotation.z * speed”? that would make a lot more sense.