scripting help (brakets)

hello i am wondering when to add brakets { } to scripts that i make can anyone help?

For a class, functions, loops, conditions, and that’s about it for your scripting skills. Examples :

function Plop()
{
    while( true )
    {
        for( var i = 0; i < 10; i++)
        {
            if( false ){}
        }
    }
}