Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김건우
/
OSS
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Authored by
Dexter Jin
2017-10-09 18:20:04 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
44888fa9c83268ef578d2f375714e4bbcf49db62
44888fa9
1 parent
27917a0a
Experiments06 Uploaded
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
264 additions
and
0 deletions
Experiments/Experiments06/Assignments/assignments01.js
Experiments/Experiments06/Assignments/assignments02.js
Experiments/Experiments06/Assignments/assignments03.js
Experiments/Experiments06/HelloWorld/hello.html
Experiments/Experiments06/HelloWorld/hello.js
Experiments/Experiments06/Tutorial/arithmeticOperator.js
Experiments/Experiments06/Tutorial/assignmentOperator.js
Experiments/Experiments06/Tutorial/bitwiseOperator.js
Experiments/Experiments06/Tutorial/comparisonOperator.js
Experiments/Experiments06/Tutorial/conditionalOperator.js
Experiments/Experiments06/Tutorial/forStatement.js
Experiments/Experiments06/Tutorial/ifelseStatement.js
Experiments/Experiments06/Tutorial/logicalOperator.js
Experiments/Experiments06/Tutorial/switchStatement.js
Experiments/Experiments06/Tutorial/typeofOperator.js
Experiments/Experiments06/Tutorial/variables.js
Experiments/Experiments06/Tutorial/whileStatement.js
Experiments/Experiments06/Assignments/assignments01.js
0 → 100755
View file @
44888fa
// Please implements multiplication tables (구구단)
Experiments/Experiments06/Assignments/assignments02.js
0 → 100755
View file @
44888fa
var
numbers
=
new
Array
(
12
,
45
,
2
,
31
,
4
,
56
,
6
,
7
);
// find out maximum number and minimum numbers
for
(
var
index
in
numbers
)
{
console
.
log
(
"index["
+
index
+
"] = "
+
numbers
[
index
]);
}
Experiments/Experiments06/Assignments/assignments03.js
0 → 100755
View file @
44888fa
var
numbers
=
new
Array
(
10
,
11
,
2
,
1
,
3
,
1
,
4
,
10
,
20
,
21
);
// Sort numbers in ascending order
Experiments/Experiments06/HelloWorld/hello.html
0 → 100755
View file @
44888fa
<html>
<body>
<script
type=
"text/javascript"
>
<!--
document
.
write
(
"Hello World"
);
//-->
</script>
</body>
</html>
Experiments/Experiments06/HelloWorld/hello.js
0 → 100755
View file @
44888fa
console
.
log
(
"Hello"
);
console
.
log
(
"Hello"
);
console
.
log
(
"Hello"
);
console
.
log
(
"Hello"
);
console
.
log
(
"Hello"
);
Experiments/Experiments06/Tutorial/arithmeticOperator.js
0 → 100755
View file @
44888fa
var
a
=
33
;
var
b
=
10
;
var
c
=
"Test"
;
console
.
log
(
"a + b = "
);
result
=
a
+
b
;
console
.
log
(
result
);
console
.
log
(
"a - b = "
);
result
=
a
-
b
;
console
.
log
(
result
);
console
.
log
(
"a / b = "
);
result
=
a
/
b
;
console
.
log
(
result
);
console
.
log
(
"a % b = "
);
result
=
a
%
b
;
console
.
log
(
result
);
console
.
log
(
"a + b + c = "
);
result
=
a
+
b
+
c
;
console
.
log
(
result
);
a
=
a
++
;
console
.
log
(
"a++ = "
);
result
=
a
++
;
console
.
log
(
result
);
b
=
b
--
;
console
.
log
(
"b-- = "
);
result
=
b
--
;
console
.
log
(
result
);
Experiments/Experiments06/Tutorial/assignmentOperator.js
0 → 100755
View file @
44888fa
var
a
=
33
;
var
b
=
10
;
console
.
log
(
"Value of a => (a = b) => "
);
result
=
(
a
=
b
);
console
.
log
(
result
);
console
.
log
(
"Value of a => (a += b) => "
);
result
=
(
a
+=
b
);
console
.
log
(
result
);
console
.
log
(
"Value of a => (a -= b) => "
);
result
=
(
a
-=
b
);
console
.
log
(
result
);
console
.
log
(
"Value of a => (a *= b) => "
);
result
=
(
a
*=
b
);
console
.
log
(
result
);
console
.
log
(
"Value of a => (a /= b) => "
);
result
=
(
a
/=
b
);
console
.
log
(
result
);
console
.
log
(
"Value of a => (a %= b) => "
);
result
=
(
a
%=
b
);
console
.
log
(
result
);
Experiments/Experiments06/Tutorial/bitwiseOperator.js
0 → 100755
View file @
44888fa
var
a
=
2
;
// Bit presentation 10
var
b
=
3
;
// Bit presentation 11
console
.
log
(
"(a & b) => "
);
result
=
(
a
&
b
);
console
.
log
(
result
);
console
.
log
(
"(a | b) => "
);
result
=
(
a
|
b
);
console
.
log
(
result
);
console
.
log
(
"(a ^ b) => "
);
result
=
(
a
^
b
);
console
.
log
(
result
);
console
.
log
(
"(~b) => "
);
result
=
(
~
b
);
console
.
log
(
result
);
console
.
log
(
"(a << b) => "
);
result
=
(
a
<<
b
);
console
.
log
(
result
);
console
.
log
(
"(a >> b) => "
);
result
=
(
a
>>
b
);
console
.
log
(
result
);
Experiments/Experiments06/Tutorial/comparisonOperator.js
0 → 100755
View file @
44888fa
var
a
=
10
;
var
b
=
20
;
console
.
log
(
"(a == b) => "
);
result
=
(
a
==
b
);
console
.
log
(
result
);
console
.
log
(
"(a < b) => "
);
result
=
(
a
<
b
);
console
.
log
(
result
);
console
.
log
(
"(a > b) => "
);
result
=
(
a
>
b
);
console
.
log
(
result
);
console
.
log
(
"(a != b) => "
);
result
=
(
a
!=
b
);
console
.
log
(
result
);
console
.
log
(
"(a >= b) => "
);
result
=
(
a
>=
b
);
console
.
log
(
result
);
console
.
log
(
"(a <= b) => "
);
result
=
(
a
<=
b
);
console
.
log
(
result
);
Experiments/Experiments06/Tutorial/conditionalOperator.js
0 → 100755
View file @
44888fa
var
a
=
10
;
var
b
=
20
;
var
linebreak
=
"<br />"
;
console
.
log
(
"((a > b) ? 100 : 200) => "
);
result
=
(
a
>
b
)
?
100
:
200
;
console
.
log
(
result
);
console
.
log
(
"((a < b) ? 100 : 200) => "
);
result
=
(
a
<
b
)
?
100
:
200
;
console
.
log
(
result
);
Experiments/Experiments06/Tutorial/forStatement.js
0 → 100755
View file @
44888fa
var
numbers
=
new
Array
(
1
,
2
,
2
,
3
,
4
)
for
(
var
num
in
numbers
)
{
// key and Value
console
.
log
(
num
+
" = "
+
numbers
[
num
]);;
}
console
.
log
(
"Exiting from the loop!"
);
Experiments/Experiments06/Tutorial/ifelseStatement.js
0 → 100755
View file @
44888fa
var
age
=
20
;
if
(
age
>
18
)
{
console
.
log
(
"Qualifies for driving"
);
}
var
age
=
15
;
if
(
age
>
18
)
{
console
.
log
(
"Qualifies for driving"
);
}
else
{
console
.
log
(
"Does not qualify for driving"
);
}
var
book
=
"maths"
;
if
(
book
==
"history"
)
{
console
.
log
(
"History Book"
);
}
else
if
(
book
==
"maths"
)
{
console
.
log
(
"Maths Book"
);
}
else
if
(
book
==
"economics"
)
{
console
.
log
(
"Economics Book"
);
}
else
{
console
.
log
(
"Unknown Book"
);
}
Experiments/Experiments06/Tutorial/logicalOperator.js
0 → 100755
View file @
44888fa
var
a
=
true
;
var
b
=
false
;
console
.
log
(
"(a && b) => "
);
result
=
(
a
&&
b
);
console
.
log
(
result
);
console
.
log
(
"(a || b) => "
);
result
=
(
a
||
b
);
console
.
log
(
result
);
console
.
log
(
"!(a && b) => "
);
result
=
(
!
(
a
&&
b
));
console
.
log
(
result
);
Experiments/Experiments06/Tutorial/switchStatement.js
0 → 100755
View file @
44888fa
var
grade
=
'A'
;
console
.
log
(
"Entering switch block"
);
switch
(
grade
)
{
case
'A'
:
console
.
log
(
"Good job"
);
break
;
case
'B'
:
console
.
log
(
"Pretty good"
);
break
;
case
'C'
:
console
.
log
(
"Passed"
);
break
;
case
'D'
:
console
.
log
(
"Not so good"
);
break
;
case
'F'
:
console
.
log
(
"Failed"
);
break
;
default
:
console
.
log
(
"Unknown grade"
)
}
console
.
log
(
"Exiting switch block"
);
switch
(
grade
)
{
case
'A'
:
console
.
log
(
"Good job"
);
case
'B'
:
console
.
log
(
"Pretty good"
);
case
'C'
:
console
.
log
(
"Passed"
);
case
'D'
:
console
.
log
(
"Not so good"
);
case
'F'
:
console
.
log
(
"Failed"
);
default
:
console
.
log
(
"Unknown grade"
);
}
console
.
log
(
"Exiting switch block"
);
Experiments/Experiments06/Tutorial/typeofOperator.js
0 → 100755
View file @
44888fa
var
a
=
10
;
var
b
=
"String"
;
result
=
(
typeof
b
==
"string"
?
"B is String"
:
"B is Numeric"
);
console
.
log
(
"Result => "
);
console
.
log
(
result
);
result
=
(
typeof
a
==
"string"
?
"A is String"
:
"A is Numeric"
);
console
.
log
(
"Result => "
);
console
.
log
(
result
);
Experiments/Experiments06/Tutorial/variables.js
0 → 100755
View file @
44888fa
var
name
=
"Ali"
;
var
money
;
money
=
2000
;
console
.
log
(
"my name is "
+
name
);
console
.
log
(
"my money is "
+
money
);
var
myVar
=
"global"
;
// Declare a global variable
function
checkscope
(
)
{
var
myVar
=
"local"
;
// Declare a local variable
console
.
log
(
"print myVar "
+
myVar
);
}
console
.
log
(
"print myVar "
+
myVar
);
checkscope
();
Experiments/Experiments06/Tutorial/whileStatement.js
0 → 100755
View file @
44888fa
var
count
=
0
;
console
.
log
(
"Starting Loop "
);
while
(
count
<
10
)
{
console
.
log
(
"Current Count : "
+
count
);
count
++
;
}
console
.
log
(
"Loop stopped!"
);
var
count
=
0
;
console
.
log
(
"Starting Loop"
);
do
{
console
.
log
(
"Current Count : "
+
count
);
count
++
;
}
while
(
count
<
5
);
console
.
log
(
"Loop stopped!"
);
Please
register
or
login
to post a comment