This can be read as:
if (times > 0) {
return string.repeat(times);
} else {
return "";
}
If you want to change selection, open document below and click on "Move attachment"
Three ways to repeat a string in JavaScript – freeCodeCamp77c9098b8ea4ad56d00f10ddffe3147?postId=2a9053b93a2d" height="250" width="700"><iframe><div> You can use a ternary operator as a shortcut for the if/else statement, like this: times > 0 ? string.repeat(times) : ""; This can be read as: if (times > 0) { return string.repeat(times);} else { return "";} You can then return the ternary operator in your function: <3A%2F%
Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details