-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
50 lines (37 loc) · 1.09 KB
/
index.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
import _ from 'lodash';
import algorithms from './src/algorithms';
import workexp from './src/workexp';
const playground = (function() {
const sayHi = () => {
console.log('Hiiiiiii!111');
console.log(_.isArray([]));
}
//sayHi();
// find pairs algo test
const array = [1, 2, 3, 4, 5, 6, -9, 10];
algorithms.extendArrayWithFindPairsAlg();
const pairs = array.findPairs(6);
//console.log(pairs);
// test debounce
const a = 'test';
const testDebounce = algorithms.debounce(function(mes) {
console.log(mes);
}, 500, a);
document.querySelector('#button').onclick = testDebounce;
// async map test
var job1 = function(cb) {
setTimeout(function() { cb('first'); }, 900);
};
var job2 = function(cb) {
setTimeout(function() { cb('second'); }, 100);
};
var job3 = function(cb) {
setTimeout(function() { cb('third'); }, 300);
};
var jobs = [job1, job2, job3];
var callback = function(results) { console.log(results); };
// algorithms.asyncMap(jobs, callback);
// test workexp
workexp.getWorkExperince();
})();
export default playground;