forked from HowProgrammingWorks/DataTypes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4-types.js
More file actions
31 lines (24 loc) · 683 Bytes
/
Copy path4-types.js
File metadata and controls
31 lines (24 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'use strict';
const i = 5;
const f = 10.3;
const s = 'Hello';
const b = true;
const o = {
name: 'Marcus Aurelius',
born: 121,
city: 'Roma',
position: 'emperor'
};
o.city = 'Odessa';
const a = ['Athens', 'Roma', 'London', 'Beijing', 'Kiev', 'Riga'];
a.push('Odessa');
a.unshift('New York');
console.log('shifted:' + a.shift());
console.log('pop: ' + a.pop());
console.log({ i }, typeof(i));
console.log({ s }, typeof(s));
console.log({ b }, typeof(b));
console.log({ f }, typeof(f));
console.log({ o }, typeof(o), { isArray: Array.isArray(o) });
console.log({ a }, typeof(a), { isArray: Array.isArray(a) });
console.log({ a }, { instanceofArray: a instanceof Array });