Camera follow

What do i need to change in my code so the camera is going to follow the player smoothly?
here is the code

    var player : GameObject;
    function Update()
    {
    this.gameObject.transform.position = new Vector3(this.gameObject.transform.position.x, player.gameObject.transform.position.y+6, this.gameObject.transform.position.z);
    }

I don’t know Javascript but here’s a real simple c# Camera Follow script!

public Transform target;

	void Update()
	{

		if (target)
		{
			transform.position = Vector3.Lerp (transform.position, target.position, 0.1f) + new Vector3 (0, 0, 0);
		}
	}
}

This is another camera follow script that works well.
using UnityEngine;
using System.Collections;

public class CameraController : MonoBehaviour {

	public GameObject followTarget;
	private Vector3 targetPos;
	public float moveSpeed;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		targetPos = new Vector3 (followTarget.transform.position.x, followTarget.transform.position.y, transform.position.z);
		transform.position = Vector3.Lerp (transform.position, targetPos, moveSpeed * Time.deltaTime);
	}
}