Error CS1022

So i was on youtube seeing a tutorial of how to make a platformer unity game i did this code and it dosen’t seem to work

using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour {

public float moveSpeed;
public float jumpHeight;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

if (Input.GetKeyDown) (KeyCode.Space)
[
GetComponent().velocity = new Vector2 {1, jumpHeight};

}
}
}

Your code was formatted wrong and did not properly close all braces. This should work:

using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour
{
    public float moveSpeed;
    public float jumpHeight;

    // Use this for initialization
    void Start ()
    {
    }

    // Update is called once per frame
    void Update ()
    {
        if (Input.GetKeyDown) (KeyCode.Space)
        {
            GetComponent<Rigidbody2D>().velocity = new Vector2 {1, jumpHeight};
        }
    }
}

It says unexpected symbol {