「JavaScript」再帰関数を利用するサンプル
サンプルコード
<script>
function demo() {
console.log("welcome to study");
setTimeout(function(){
demo();
},1000);
}
demo();
</script>
<script>
function demo() {
console.log("welcome to study");
setTimeout(function(){
demo();
},1000);
}
demo();
</script>
<script> function demo() { console.log("welcome to study"); setTimeout(function(){ demo(); },1000); } demo(); </script>