Hi everyone,
i am doing my study in full stack development, so i am stuked in this code can someone help me out.
const paddedString = ’ '.repeat(startPaddingLength) + string + ’ '.repeat(endPaddingLength);
return paddedString;
The terminal shows RangeError: Invalid count value at string repeat
so please help me out of it then i can go ahead…
Hello.
Try printing the startPaddingLength
and endPaddingLength
values before these lines of code. You may get a RangeError
if the repeat()
method parameter is negative.
Thanx sir i will try it
This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.