How to call animations in JS

Hi, i would like to know how to call an animation from my Character Motor replacement script. Im pretty sure i have to make variables and call something from either an animator or a game object but the animations themselves are not on the player in any way. If i can call them from the folder thats fine but i believe i can also put them in an animation component (not sure thats why im asking). So how would i go about doing this stuff. I watched the unity mechanim tutorial and it uses C# but i need to know if JS. thanks in advance and the script is below!

// If running is enabled, change to run speed when left shift is pressed:
		if (Input.GetKey(KeyCode.LeftShift) && enableRun == true)
		{
			speed = runSpeed;
		}
		// If crouching is enabled, change to crouch speed when "c" is pressed:
		else if (Input.GetKey("c") && enableCrouch == true)
		{
			speed = crouchSpeed;
		}
		// If nothing is pressed, use walkSpeed:
		else
		{
			speed = walkSpeed;
		}

I figured it out, no need for this