I have a code that I need to run exactly n times in Swift. What is the shortest possible syntax for that?
n
I am currently using the for loop but
for
Speaking of syntax, you might define your own shortest syntax:
extension Int { func times(_ f: () -> ()) { if self > 0 { for _ in 0.. ()) { if self > 0 { for _ in 0..