mirror of
https://github.com/hsokolowski/iTree.git
synced 2026-06-11 22:34:16 -04:00
tsp weight working
This commit is contained in:
19
src/services/playground2.js
Normal file
19
src/services/playground2.js
Normal file
@@ -0,0 +1,19 @@
|
||||
var predicates = {
|
||||
'==': function (a, b) {
|
||||
return a === b;
|
||||
},
|
||||
'>=': function (a, b) {
|
||||
return a >= b;
|
||||
},
|
||||
'<': function (a, b, item) {
|
||||
return item[a] < item[b];
|
||||
},
|
||||
};
|
||||
let p = predicates['<'];
|
||||
let item = {
|
||||
a: 1,
|
||||
b: 2,
|
||||
};
|
||||
console.log(item['a'], item['b']);
|
||||
console.log(item['a'] < item['b']);
|
||||
console.log(p('a', 'b', item));
|
||||
Reference in New Issue
Block a user