「JavaScript」関数側にsetIntervalを配置するサンプル
書式
function () {
setInterval(function () {
処理コード
},秒数);
使用例
<script>
const funA = function () {
setInterval(function () {
console.log("2秒経過しました");
}, 2000);
};
funA();
</script>
Coding Changes the World
書式
function () {
setInterval(function () {
処理コード
},秒数);
使用例
<script>
const funA = function () {
setInterval(function () {
console.log("2秒経過しました");
}, 2000);
};
funA();
</script>