WaitForSeconds not working in js

It is supposed to wait a second before doing the next step but it just does it all at once.

function clickedgo ()
{

	
	for(var i=0;i<slidervalue;i++)
	{
		var rand = Mathf.Round(Random.value);
		if(rand==1)
		gotpos();
		else
		gotneg(); //basically just choose one of the 2 functions by random
		
		StartCoroutine(waitasec()); //also tried without startcoroutine

	}
}


function waitasec ()
{
	//wait command
	yield WaitForSeconds(1);
}

You need to put the yield directly into the ClickedGo function.

function clickedgo ()
{
for(var i=0;i<slidervalue;i++)
{
var rand = Mathf.Round(Random.value);
if(rand==1)
gotpos();
else
gotneg(); //basically just choose one of the 2 functions by random

         //wait command
         yield WaitForSeconds(1);
     }
 }

Your code should look like this. Then you write StartCoroutine(clickedgo()) when you want your for loop to start.