Skip to content

Instantly share code, notes, and snippets.

@sajid-haniff
sajid-haniff / gist:b275c88400be57af4714a3a391d308d4
Created October 27, 2023 00:42
This code provides utilities for handling and searching through operator data in JavaScript (ES6).
// Sample operator data for demonstration purposes
const operators = {
'+': { name: '_ADD', infix: { name: '_PLUS' }, prefix: null },
'-': { name: '_SUB', infix: { name: '_MINUS' }, prefix: { name: '_NEGATE' } },
'*': { name: '_MUL', infix: null, prefix: null },
'/': { name: '_DIV', infix: null, prefix: null },
// ... potentially other operators ...
};
// Create a set of all operator names