leo/compiler/tests/array/spread.leo

6 lines
165 B
Plaintext
Raw Normal View History

// A spread operator `...` copies the elements of one array into another
2020-09-02 21:12:12 +03:00
function main(a: [u8; 3]) {
2020-07-30 10:56:17 +03:00
let b = [1u8, 1u8];
2020-08-17 03:20:47 +03:00
console.assert(a == [1u8, ...b]);
}