I am new to JS. I suspect it has something to do with the printout on console.
Can someone please help me understand what the function does in the following JS code snippet? Much appreciated!!
JS code snippet:
console.log("Registering Machines && Units...");
(function() {
var P = ["\\", "|", "/", "-"];
var x = 0;
return setInterval(function() {
process.stdout.write("\r" + P[x++]);
x &= 3;
}, 250);
})();