java script to c#

hi , i never learned/used java , i have a script ( i found it on internet ) is in the java script form ! but i need that in c# to add some more scripting to it ! the java script is working perfectly fine ! can anyone please tell me its C# equivalent ??

here is the script :

///////////////////////////// #pragma strict

var distToGround: float;
var jumpspeed: float;

function Start(){
// get the distance to ground
distToGround = GetComponent.().bounds.extents.y;
}

function IsGrounded(): boolean {
return Physics.Raycast(transform.position, -Vector3.up, distToGround + 0.1);
}

function Update () {
if (Input.GetKeyDown(KeyCode.Space) && IsGrounded()){
GetComponent.().velocity.y = jumpspeed;
}
}

/////////////////////////////

Thanks : )

float distToGround;
float jumpspeed;
Rigidbody rb;

void Start(){

    // get the distance to ground
        distToGround = GetComponent<Collider>().bounds.extents.y;
        
        //cache Rigidbody component
        rb = GetComponent<Rigidbody>();
        
}

bool IsGrounded(){

    return Physics.Raycast(transform.position, -Vector3.up, distToGround + 0.1f);
    
}

void Update () {

    if (Input.GetKeyDown(KeyCode.Space) && IsGrounded())
    { 
        rb.velocity = new Vector3(0f, jumpspeed, 0f);
    }
    
}

@pako thanks ,now this worked for me !! : ) you are great bro !

Here is a good place to go to so you don’t have to constantly ask how to convert most unity 5 scripts will be easy to convert with this anything 4 and lower and you’ll have problems

http://www.m2h.nl/files/js_to_c.php