What is wrong with my script? (noob at c#),What is wrong with my script?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class throwPortal : MonoBehaviour {

public GameObject LeftPortal;
public GameObject RightPortal;

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

// Update is called once per frame
void Update () {
    if (Input.GetMouseButtonDown(0))
        Debug.Log("LeftClick");
    throwPortal(LeftPortal);
    
if (Input.GetMouseButtonDown(1))
        Debug.Log("RightClick");
    throwPortal(RightPortal);

    void throwPortal (GameObject Portal)

}
}

you can not use void in the if-statement, and you need to ad brackets in your if-statement:

 public GameObject LeftPortal;
 public GameObject RightPortal;

 

 void Update () {
     if (Input.GetMouseButtonDown(0))
      {
         Debug.Log("LeftClick");
         throwPortal(LeftPortal);
      }
     
    if (Input.GetMouseButtonDown(1))
      {
         Debug.Log("RightClick");
         throwPortal(RightPortal);
      }
}

void throwPortal (GameObject Portal)
   {
    //Do whatever you want
   }