-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
127 lines (97 loc) · 2.28 KB
/
index.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
require("babel-core")
/////// LET VS VAR /////////////////
// var type = 'Hello'
//
//
//
// while(true){
// var type = 'World' //CHANGE TO LET TO SEE THE DIFFERENCE
// console.log(type);
// break
// }
//
// console.log(type);
//////////// CONSTANT VARIABLES //////////////////////
// const PI = Math.PI
//
// PI = 123
// const moment = require('moment')
////////////// CLASSES ////////////////////////
// class Bear {
// constructor(){
//
// this.type = 'bear'
// }
// says(say){
// console.log(this.type + ' says ' + say);
// }
// }
//
// class Grizzly extends Bear{
// constructor(){
// super()
// this.type = 'grizzly'
//
// }
// }
// let bear = new Grizzly();
// let bear = new Bear;
// bear.says('growl')
////////////// ARROW FUNCTIONS /////////////////////
// let teams = ['Giants' , 'Jets' , 'Yankees'].filter(function(team){
// return team !== 'Yankees'
// })
// console.log(teams);
//
//
// let teams = ['Giants' , 'Jets' , 'Yankees'].filter((team) => team !== 'Yankees')
// console.log(teams);
//////////////// ARROW FUNCTIONS - THIS ///////////////////////////////
// class Bear {
// constructor(){
// this.type = 'bear'
// }
// says(say){
// setTimeout( () => {
// console.log(this.type + ' says ' + say)
// }, 1000)
// }
// }
//
// var bear = new Bear()
// bear.says()
////////////////// TEMPLATE STRINGS /////////////////////
// var team1 = 'Giants'
// var team2 = 'Jets'
// var teams = [
// 'giants',
// 'jets'
// ].join()
// console.log(team1);
// console.log(team2);
// console.log(teams);
//
// var sentence = "I love " + team1 + " And " + team2 + " !"
// console.log(sentence);
// let sentence = `I love ${team1} and ${team2} !`
// console.log(sentence);
////////////// DECONSTRUCTORS ///////////////////////
// let team1 = 'jets'
// let team2 = 'giants'
// var teams = {team1: team1, team2:team2} //native
// console.log(teams);
// let teams = {team1,team2} //es6
// console.log(teams);
/////////////// DEFAULT PAPAMETERS ////////////////////
//
// function bear(type = 'grizlly'){ //es6
// //type = type || 'grizzly' //native
// console.log(type);
// }
// bear();
////////////// MULTIPLE PARAMETERS /////////////////
//
// function bears (...types){
// console.log(types);
// }
// bears('polar' , 'grizzly');