# Translating TypeScript to Rust #3

**Remember that every translation is subject to inaccuracies in some cases**. Feel free to correct or suggest better translations in the comments.

### 3.1 - Tuples

#### TypeScript

```ts
const position: [number, number] = [23.45348, 24.92868];
```

#### Rust

```rs
let position: (f32, f32) = (23.45348, 24.92868);
```

### 3.2 - Arrays

#### TypeScript

```ts
const array = [1, 2, 3, 4];
```

#### Rust

```rs
let array = [1, 2, 3, 4];
```

### 3.3 - Building (Transpiling & Compiling)

#### TypeScript

```bash
$ npx tsc
```

#### Rust

```bash
$ cargo build
```

### 3.4 - Ternary operator

#### TypeScript

```ts
const condition: boolean = true;
const result: number = condition ? 1 : 2;
```

#### Rust

```rs
let condition: bool = true;
let result: i32 = if condition { 1 } else { 2 };
```

