formations/javascript/base/variables-2.md

24 lines
447 B
Markdown
Raw Permalink Normal View History

2015-03-25 17:27:03 +01:00
# .cadoles-slide-title[Variables (2/2)]
**Types**
```js
var foo;
// Types primaires
foo = 0; // Number, pas de distinction entre nombres flottants ou entiers
foo = 'baz'; // String, peut être délimité par ' ou ", pas de signification particulière
foo = true; // Boolean
// Types composites
foo = { prop1: 'World' }; // Object
foo = [1, 2, 3]; // Array
// Types spéciaux
foo = undefined;
foo = null;
foo = NaN;
```