Something went wrong. Try again.
A component based functional template language
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758component Loop { let array = [1, 2, 3, 4, 5]; for (index, item in array) { item * index }}component LoopNested { let array = [[1, 2], [3, 4], [5, 6]]; for (index, items in array) { for (index2, item in items) { index + index2 + item } }}component LoopContinue { let array = [1, 2, 3, 4, 5, 6, 7, 8]; for (item in array) { if (item % 2 != 0) { continue; }; item }}component LoopBreak { let array = [1, 2, 3, 4, 5, 6, 7, 8]; for (index, item in array) { if (index == 3) { break; }; item }}component LoopBreakNested { let array = [1, 2, 3, 4, 5, 6, 7, 8]; for (n in 1...3) { if (n > 2) { break; }; for (item in array) { if (n == 2 && item == 4) { break; }; item } }}component LoopString { let characters = fn (string) -> %%pinc_string_characters%%; for (c in characters("abcdéfg")) { <span>{c}</span> }}