Random on/off function

hi all i am really a noob in programming so i am really pleased if someone can help me with this!

I am looking for a function (for a particle emitter) to turn it off and on at random intervals. I used the search function on this website and already came accoss a topic that was about waiting random seconds but this is still not what i am looking for…

This is one of the first things i am trying to make in Unity, help is really appriciated!

This will toggle the emitter in random intervals between 1 and 5 seconds

function Start()
{
    while(true)
    {
        yield WaitForSeconds(Random.Range(1.0,5.0));
        particleEmitter.emit = !particleEmitter.emit;
    }
}

or maybe you want to just burst out some particles

function Start()
{
    particleEmitter.emit = false;
    while(true)
    {
        yield WaitForSeconds(Random.Range(1.0,5.0));
        particleEmitter.Emit(20);
    }
}

That was so quick! And so helpfull!

Thank you very much Bunny!

Is there also a way to make the particle emitter shoot shorter burst of particles?