-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
92 lines (78 loc) · 3.72 KB
/
test.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="js-plus.js"></script>
</head>
<body>
<ul id="mainul">
<li class="mainli">dsf</li>
<li class="mainli">sdaf</li>
</ul>
<button style="display: block;" onclick="jP.hide('li')">Hide</button>
<button style="display: block;" onclick="jP.show('li')">Show</button>
<button style="display: block;" onclick="jP.fade('li', 1, 0)">Fade Out</button>
<button style="display: block;" onclick="jP.fade('li', 1, 1)">Fade In</button>
<button style="display: block;" onclick="jP.toggle('li')">Toggle</button>
<script type="text/javascript">
var strings = ['кришна', 'кришна', 'харе', 'харе',
'харе','кришна', 'кришна', '8-()',
'харе', 'кришна', 'кришна', '8-()'
];
var salaries = {
'1': 100,
'2': 300,
'3': 250
};
var users = [
{ name: "Вася", surname: 'Иванов', age: 20 },
{ name: "Петя", surname: 'Чапаев', age: 25 },
{ name: "Маша", surname: 'Медведева', age: 18 },
{ name: "Маша", surname: 'Медведева', age: 1}
];
console.log('******** Array *********')
console.log("jP.lastOf([1, 2, 3, 4, 5]): " + jP.lastOf([1, 2, 3, 4, 5]) );
console.log("jP.sumOfArr([1, 2, 3, 4, 5]): " + jP.sumOfArr([1, 2, 3, 4, 5]) );
console.log("jP.randomOf([1, 2, 3, 4, 5]): " + jP.randomOf([1, 2, 3, 4, 5]) );
console.log("jP.shuffle([1, 2, 3, 4, 5]): " + jP.shuffle([1, 2, 3, 4, 5]) );
console.log("jP.reverse([1, 2, 3, 4, 5]): " + jP.reverse([1, 2, 3, 4, 5]) );
console.log("jP.unique(strings): " + jP.unique(strings) );
console.log("jP.lenOfArrVals(['Есть', 'жизнь', 'на', 'Марсе']): " + jP.lenOfArrVals(['Есть', 'жизнь', 'на', 'Марсе']) );
console.log("jP.sortArr(['HTML', 'Ajax', 'JavaScript', 'CSS']): " + jP.sortArr(["HTML", 'Ajax', "JavaScript", "CSS"]) );
console.log("jP.sortArrByRange([1, 2, 3, 4, 5], 2, 3) ): " + jP.sortArrByRange([1, 2, 3, 4, 5], 2, 3) );
console.log("jP.evenInArr([1, 2, 3, 4, 5]): " + jP.evenInArr([1, 2, 3, 4, 5]) );
console.log("jP.missing([2, 3, 4]): " + jP.missing([2, 3, 4]) );
console.log("jP.missing([5, 1, 4, 2, 7]): " + jP.missing([5, 1, 4, 2, 7]) );
console.log("jP.missing([1, 2, 3, 4]): " + jP.missing([1, 2, 3, 4]) );
console.log('******** Array *********')
console.log(' ');
console.log('******** String *********')
console.log("jP.camelCase('list-style-image'): " + jP.camelCase('list-style-image') );
console.log("jP.capitalize('string'): " + jP.capitalize('string') );
console.log("jP.isPolindrome('abcdcba'): " + jP.isPolindrome('abcdcba') );
console.log('******** String *********')
console.log(' ');
console.log('******** Numbers *********')
console.log("jP.sumOfN(4): " + jP.sumOfN(4) );
console.log("jP.factorial(3): " + jP.factorial(3) );
console.log("jP.pow(2, 12): " + jP.pow(2, 12) );
console.log("jP.decimal(12340324342.3343242342342323232135): " + jP.decimal(12340324342.3343242342342323232135) );
console.log("jP.decimal(123456789123456.12): " + jP.decimal(123456789123456.12) );
console.log("jP.decimal(1.2): " + jP.decimal(1.2) );
console.log("jP.decimal(-1.2): " + jP.decimal(-1.2) );
console.log("jP.randomNum(2, 4): " + jP.randomNum(2, 4) );
console.log('******** Numbers *********')
console.log(' ');
console.log('******** Object *********')
console.log("jP.maxOfObj(salaries): " + jP.maxOfObj(salaries) );
console.log("jP.isEmpty(salaries): " + jP.isEmpty(salaries) );
console.log("jP.sumOfObj(salaries): " + jP.sumOfObj(salaries) );
var clone = {};
jP.cloneObj(salaries, clone)
console.log("jP.cloneObj(salaries, clone): " + clone);
console.log("jP.sortObjsByField(users, 'age'): " + jP.sortObjsByField(users, 'age') );
console.log('******** Object *********')
</script>
</body>
</html>