Skip to content

Commit 15dc3b4

Browse files
committed
update your playground
1 parent b299bdb commit 15dc3b4

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ <h3>Project Solutions</h3>
5252

5353
<script src="yourPlayground.js"></script>
5454
<script src="exercises/converthourstoseconds.js"></script>
55+
<script src="main.js"></script>
5556
</body>
5657

5758
</html>

main.js

Whitespace-only changes.

yourPlayground.js

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,42 @@
11

2-
const introducer = (name, role) => {
2+
// Objects
33

4+
const myIntro = (name, role, company) => {
45
const person = {
56
name: name,
6-
role: role
7+
role: role,
8+
company: company,
9+
assets: 130000,
10+
liabilites: 50000,
11+
netWorth: function () {
12+
return this.assets - this.liabilites;
13+
}
714
}
8-
9-
const intro = `Hi, my name is ${person.name} and I am ${person.role} at Ennova Research SRL`;
15+
const intro = `Hi, my name is ${person.name} and I am ${person.role} at ${person.company}. My net worth is $${person.netWorth()}`;
1016
return intro
1117
}
18+
// console.log(myIntro("Miraze", "Head of Design", "Ennova Research SRL"))
19+
20+
const frutta = ['🍏','🍐','🍉','🍓','🍌','🍇'];
21+
22+
// for (let i = 0; i < frutta.length; i++ ) {
23+
// console.log(i, frutta[i]);
24+
// }
25+
26+
for (const frut of frutta) {
27+
// console.log(frut);
28+
}
29+
30+
31+
32+
const numeri = [1, 2, 3, 4, 5, 6]
33+
34+
let numerix2 = [];
35+
36+
for (const numero of numeri) {
37+
numerix2.push(numero ** 2);
38+
}
39+
40+
// console.log(numerix2);
41+
1242

13-
console.log(introducer("Miraze", "Head of Design"))

0 commit comments

Comments
 (0)