-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
32 lines (22 loc) · 774 Bytes
/
main.js
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
32
const firstNames = ['Adam', 'Bartosz', 'Cezary', 'Dariusz', 'Edward'];
const firstName = firstNames[Math.floor(Math.random() * firstNames.length)];
const age = Math.floor(Math.random() * 50) + 18;
console.log(`Nazywam się ${firstName} i mam ${age} lat.`);
const header = document.querySelector('.page-header__heading--js');
header.innerHTML = `Nazywam się ${firstName} i mam ${age} lat.`;
const calculate = myNumber => (myNumber+4)*7
calculate(1)
const result = calculate(2);
console.log(result);
const deathStar = {
diameter: 120000,
fire: (target) => {
console.log(`${target} destroyed 💥`)
},
isOperating: true,
levels: 357,
name: 'Death Star',
population: 10000
}
console.log(deathStar.name)
deathStar.fire('Rebel ship')