JSFiddle - React, Tailwind, and code Playground JavaScript var x, i = 1; if (i == 2) x=1; else x=i+1; console.log(x);