Closures
If you need more complex logic to initialize your variables you might want to reach for a closure expression.
- Knot
- TypeScript
knot
const result = {let lhs = 90;let rhs = {let initial = 4;123 - initial;};lhs * 10 > rhs;};
knot
const result = {let lhs = 90;let rhs = {let initial = 4;123 - initial;};lhs * 10 > rhs;};
tsx
const result = (function () {let lhs = 90;let rhs = (function () {let initial = 4;return 123 - initial;})();return lhs * 10 > rhs;})();
tsx
const result = (function () {let lhs = 90;let rhs = (function () {let initial = 4;return 123 - initial;})();return lhs * 10 > rhs;})();