-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
32 lines (25 loc) · 758 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
import 'core-js';
// import -keyword
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
import Human from './Human';
const name = "Kekkonen";
const age = 34;
// Shorthand objects
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#New_notations_in_ECMAScript_2015
const saleSettings = {
name,
age
};
// // Old way
// const saleSettings = {
// name: name,
// age: age
// }
const Sale = new Human(saleSettings);
Sale.sayHello();
// Destructuring
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
// const { name, age } = Sale;
// Yo. on sama ku ao.
// const name = Sale.name;
// const age = Sale.age;