JSFiddle - React, Tailwind, and code Playground JavaScript var n = [1,2,3]; var error = 0; $.each(n, function (i, item) { error++; }); alert(error);