> For the complete documentation index, see [llms.txt](https://dashboard-hero.gitbook.io/dashboard-hero/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dashboard-hero.gitbook.io/dashboard-hero/basics/javascript.md).

# Javascript

We'll shed some light on some mysterious Javascript constructs that are unfamiliar when you come from a different programming language. The 3 below are everything that should suprise you, that you will find used with Dashboard Hero or in adjacent libraries.

#### Equality comparators

Because objects are not strongly typed, there's an equality comparator that also does type checking: `===`

Quick example:

```
var num = 0;
var obj = new String('0');

console.log(num == obj); // true
console.log(num === obj); // false
```

[Further reading](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness)

#### Destructuring objects

Unpacks values from arrays.

Quick example:

`[a, b] = [10, 20]; console.log(a); // expected output: 10`

[Further reading](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment)

#### Three dots operator

Array comprehension utility.

Quick example:

```
var parts = ['shoulders', 'knees']; 
var lyrics = ['head', ...parts, 'and', 'toes']; 
// ["head", "shoulders", "knees", "and", "toes"]
```

[Further reading](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax)
