Hacker symbol

November 13, 2019 ~ 1 min read

Arrays


This is how to declare an array with a size and type:

// This determines the type and size
let a: [i32; 5] = [1, 2, 3, 4, 5];
// This determines repeating elements
let a = [3; 5];
// [3, 3, 3, 3, 3]

Sebastian BolaƱos

Hi, I'm Sebastian. I'm a software developer from Costa Rica. You can follow me on Twitter. I enjoy working on trustless systems.