HELP!! expecting :, found ';' problem

Ok, I wrote a javascript that could switch my flashlight on and off and I get this ERROR message,

Assets/Scripts/Player/Flashlight.js(19,29): BCE0044: expecting :, found ';'.

and here's the script:

var FlashLight_On = true;
var intensity : float;

function Update () {

if (FlashLight_On == true)
    {

    light.intensity == 3.1;

if (Input.GetKeyDown(KeyCode.L))
    {
        FlashLight_On == false;
    }
}   
else (FlashLight_On == false);
    {

    light.intensity == 0.0;

    }

}

I have no idea what's wrong with my script.

BCE0044: expecting :, found ';'.

Use "=" instead of "==" in the assignments?

This should work just fine. Looks prettier too :) .

var FlashLight_On = true;
var intensity : float;

function Update(){

if (FlashLight_On)
    light.intensity = 3.1;
else
    light.intensity = 0.0;

if (FlashLight_On&&Input.GetKeyDown(KeyCode.L))
    {
        FlashLight_On = false;
    }
}