tsp weight working

This commit is contained in:
Hubert Sokołowski
2021-04-13 00:16:53 +02:00
parent 78ffa63ad1
commit 7959b9bcea

View 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));