save result in variable

This commit is contained in:
Baipyrus 2023-12-10 16:02:45 +01:00
parent a5b9f37f36
commit e1631e5415

View File

@ -79,7 +79,8 @@ while (open.length > 0) {
open.push(next); open.push(next);
} }
} }
console.log(closed.sort((a, b) => b.distance - a.distance)[0].distance); const furthest = closed.sort((a, b) => b.distance - a.distance)[0];
console.log(furthest.distance);
const t1 = performance.now(); const t1 = performance.now();
console.log(`Runtime: ${t1 - t0}ms`); console.log(`Runtime: ${t1 - t0}ms`);