<script> var num=1; var timer=null; var max=10; function inCreamentNum(){ console.log(num); num++ if (num<=max) { setTimeout(b,1000) }else { clearTimeout() } } te=setTimeout(b,1000) </script>