How to create an object 2D Js

My game is a top down zombie shooter, and I would like to know how to create an object when i press left arrow, right, up, down. But I don’t know how for 2d, I think im suppose to use insantsiat or w/e but I don’t know how.

var object : GameObject;
var left : KeyCode;
var right : KeyCode;
var up : KeyCode;
var down : KeyCode;

function Update(){
     if (Input.GetKeyDown("left" || "right" || "up" || "down")){
          Instantiate(object, Vector3(0, 0, 0), Quaternion.identity);
     }
}

var object : GameObject;
var left : KeyCode;
var right : KeyCode;
var up : KeyCode;
var down : KeyCode;

function Update(){
     if (Input.getKeyDown("left" || "right" || "up" || "down")){
          Instantiate(object, Vector2(0, 0), Quaternion.identity);
     }
}

var object : GameObject;
var left : KeyCode;
var right : KeyCode;
var up : KeyCode;
var down : KeyCode;

function Update(){
     if (Input.getKeyDown("left" || "right" || "up" || "down")){
          Instantiate(object, Vector2(0, 0), Quaternion.identity);
     }
}