JSFiddle - React, Tailwind, and code Playground

HTML

<div class="slider1"></div>

CSS

.slider1 {
            width: 500px;
            height: 250px;
            margin: 0 auto;
            background-color:#aaf;
            # background-image: url(images/rectblue.png);
        }

JavaScript

var flashSlider = function () {
    console.debug("Flashing");
    $(".slider1").fadeOut(2000, function () {
        $(".slider1").fadeIn(2000);
    });
}
$(document).ready(function () {
    setInterval(flashSlider, 4000);
});

//
//This runs the function 'runForever' one time only, how to run it every 4 sec? 
//the above commented out code does not work.