-
Notifications
You must be signed in to change notification settings - Fork 405
Expand file tree
/
Copy pathtest.js
More file actions
37 lines (31 loc) · 733 Bytes
/
test.js
File metadata and controls
37 lines (31 loc) · 733 Bytes
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
// function factorial(number){
// if(number == 1){
// return number;
// }else{
// return number * factorial(number-1);
// }
// }
// print(factorial(5));
// function compare(num1, num2) {
// return num1 - num2;
// }
// var nums = [3,1,2,100,4,200];
// nums.sort(compare);
// print(nums); // 1,2,3,4,100,200
// Array.matrix = function(numrows,numcols,initial){
// var arr = [];
// for(var i=0;i<numrows;i++){
// var columns = [];
// for(var j=0;j<numcols;++j){
// columns[j]=initial;
// }
// arr[i]=columns;
// }
// return arr;
// }
// var nums = Array.matrix(5,5,[1,2,3]);
// print(nums);
var grades = [[89, 77, 78],[76, 82, 81],[91, 94, 89]];
print(grades[0][0]);
print(grades[0][1]);
print(grades[0][2]);