-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharrow-functions.js
More file actions
34 lines (25 loc) · 695 Bytes
/
Copy patharrow-functions.js
File metadata and controls
34 lines (25 loc) · 695 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
32
33
34
// function exampleWithArguments() {
// console.log(arguments);
// }
const shoppingList = [
'apples',
'eggs',
'easter chocolate',
'ham',
'spinach'
];
// shoppingList.forEach(function(item) {
// console.log(item);
// });
// shoppingList.forEach(item => console.log(item));
// console.log(
// shoppingList.map(item => item.toUpperCase())
// );
// shoppingList.forEach((item) => console.log(item));
// shoppingList.forEach((item, idx) => console.log(idx, item));
function Announcer() {
this.message = 'Message to announce';
setTimeout(() => console.log(this.message), 1000);
}
const announcer = new Announcer();
announcer.message = 'A new message';