Dexter Jin

Experiments07 Materials Updated

...@@ -11,5 +11,8 @@ var bookList = new Array(new book("Perl1", "Mohtashim"),new book("Smith", "Mohta ...@@ -11,5 +11,8 @@ var bookList = new Array(new book("Perl1", "Mohtashim"),new book("Smith", "Mohta
11 11
12 console.log(bookList); 12 console.log(bookList);
13 console.log("After Sorting"); 13 console.log("After Sorting");
14 -//bookList.sort(sortBook); 14 +bookList.sort(sortBook);
15 +// sortBook 이라는 comparing function을 완성하시오.
16 +// 1 순위 : title
17 +// 2 순위 : author
15 console.log(bookList); 18 console.log(bookList);
......
...@@ -3,5 +3,9 @@ function slice(str, start, end) { ...@@ -3,5 +3,9 @@ function slice(str, start, end) {
3 } 3 }
4 var str = "Apples are round, and apples are juicy."; 4 var str = "Apples are round, and apples are juicy.";
5 var sliced = str.slice(1, 3); 5 var sliced = str.slice(1, 3);
6 +
7 +// String.slice method와 동일하게 동작하는 slice function을 구현하시오.
8 +// 아래의 console.log 2개의 출력이 동일해야 함
9 +
6 console.log( sliced ); 10 console.log( sliced );
7 console.log( slice(str, 1, 3)); 11 console.log( slice(str, 1, 3));
......
...@@ -2,5 +2,9 @@ function reverse (input) { ...@@ -2,5 +2,9 @@ function reverse (input) {
2 2
3 } 3 }
4 var arr = [0, 1, 2, 3]; 4 var arr = [0, 1, 2, 3];
5 +
6 +// Array.reverse Method와 동일하게 동작하는 reverse function을 구현하시오.
7 +// 아래의 console.log 2개의 출력이 동일해야 함
8 +
5 console.log ("Reversed array is : " + arr.reverse() ); 9 console.log ("Reversed array is : " + arr.reverse() );
6 console.log ("Reversed array is : " + reverse(arr)); 10 console.log ("Reversed array is : " + reverse(arr));
......