-
Notifications
You must be signed in to change notification settings - Fork 0
/
grammar.js
110 lines (73 loc) ยท 1.33 KB
/
grammar.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
var x;
x = 6;
console.log(x);
var str = "Hello World"
console.log(str);
//์๋ฐ์คํฌ๋ฆฝํธ 7๊ฐ์ง ๋ฐ์ดํฐ ํ์
//number, string, boolean, null, undefined, symbol, object
var num1 = 1001;
var num2 = 10.50;
var string1 = "Hello";
var stirng2 = 'World';
var bool = true;
var foo = null;
var bar;
var obj = {name:'Lee', gender:'male'};
var arr = [1,2,3];
var foo = function(){};
var area = 5*4;
console.log(obj)
console.log(obj,area)
var str = "My name is " + "Lee";
var color = "red";
var foo = 3>5;
var bar = (5>3) && (2<4);
var x = 5 + 6;
function foo(arg) {
return ++arg;
}
var i = 0;
while (1){
if (i>5){
break;
}
console.log(i);
i++;
}
var x = 5;
var y = 6;
var z = x + y;
console.log(z);
function myFunction(x,y){
return x+y;
}
if(x>0){
}
for (var i = 0; i < 10; i++){
}
var time = 10;
var greeting;
if (time<10){
greeting = "Good morning";
} else if (time<20){
greeting = "Good day";
} else{
greeting = "Good evening";
}
console.log(greeting)
function square(number){
return number * number;
}
console.log(square(2));
var person = {
name: 'Lee',
gender: 'male',
sayHello: function(){
console.log('Hi! My name is ' + this.name);
}
};
console.log(typeof person);
console.log(person);
person.sayHello();
var arr = [1,2,3,4,5];
console.log(arr[1]);