loop in jscript practice