Im new so if you're ganna flame me then don't read this

So I just started learning Unity and Java at the same time, and I’m a rank 1 newbie. The project I’m working on has a ball that moves side to side on a flat plane with the ability to jump. I’m writing this in Unity 5.1 and the tutorial I’m watching is in Unity 4.x. I have the exact code of the tutorial copied down, but being new to Java I have no way of knowing why Unity 5.1 is not accepting the code, nor do I have a direction in which I can start to look.

Here are the errors I am receiving:
Assets/MoveBall.js(13,26): BCE0043: Unexpected token: ).
Assets/MoveBall.js(13,27): BCE0044 expecting ), found ‘.’.
Assets/MoveBall.js13,28): UCE0001 ‘;’ expected. Insert a semicolon at end.
Assets/MoveBall.js(17,26): BCE0043 Unexpected token: ).
Assets/MoveBall.js(17,26): BCE0044 expecting ), found ‘.’.
Assets/MoveBall.js(17,28): UCE0001 ‘;’ expected. Insert a semicolon at end.

I don’t understand the errors that are appearing. For instance it says that lines 13 and 17 expects a semicolon. but there is clearly a semicolon right there at the end, so I just don’t get it. I’m probably not understanding how to read the error messages, but for the life of me I don’t even know how to ask google what I am doing wrong, and this is driving me insane because i literally just picked this up and it’s already broken.

GetComponent()

to

GetComponent.<Rigidbody>()

note the dot after GetComponent it required in java

It’s because you’re using JavaScript; GetComponent<Rigidbody>() works for C#, but not JS. You have to place a “.” after GetComponent. Here are the two ways you can write this:

GetComponent.<Rigidbody>().AddRelativeTorque(Vector3.back * rotation);

or

GetComponent(Rigidbody).AddRelativeTorque(Vector3.back * rotation);