вот один пример:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head></head>
<body>
<script type="text/javascript">
var global_parameter = 0;
setInterval(function()
{
console.log(global_parameter);
global_parameter += 6;
}, 1000);
</script>
</body>
</html>
вот второй пример:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head></head>
<body>
<script type="text/javascript">
var obj = new Object();
obj.param = 0;
obj.animate = function(ths)
{
return function()
{
console.log(ths.param);
ths.param += 3;
}
}
setInterval(obj.animate(obj), 1000);
</script>
</body>
</html>