Format example scripts better.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
// This script runs for-loops
|
||||
|
||||
const MAX = 1_000_000;
|
||||
|
||||
print(`Iterating an array with ${MAX} items...`);
|
||||
@@ -8,6 +10,7 @@ let now = timestamp();
|
||||
|
||||
let list = [];
|
||||
|
||||
// Loop over range
|
||||
for i in 0..MAX {
|
||||
list.push(i);
|
||||
}
|
||||
@@ -16,6 +19,7 @@ print(`Time = ${now.elapsed} seconds...`);
|
||||
|
||||
let sum = 0;
|
||||
|
||||
// Loop over array
|
||||
for i in list {
|
||||
sum += i;
|
||||
}
|
||||
|
Reference in New Issue
Block a user