JSFiddle - React, Tailwind, and code Playground JavaScript function repeat(s, n){ return ((new Array(n+1)).join(s)); } alert(repeat('R', 10));