We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not everyone knows this function-in-object-shorthand trick (known as an ObjectMethod in e.g. Babel AST), but I like it:
const methods = { mul(a, b) { return a * b; }, pow(a, b) { return a ** b; }, }; const R201 = Algebra(2,0,1); const mul = R201.inline(methods.mul); console.log(mul);
However, it doesn't work right now. A workaround for the inline function:
inline
var txt = (intxt instanceof Function) ? intxt.toString() : `function(){return (${intxt})}`; // Handle methods in object notation like: {mul(a, b) {return a * b;}} if (!(txt.startsWith('(') || txt.startsWith('function'))) { txt = 'function ' + txt; }
Currently it just fails:
Uncaught SyntaxError: Unexpected token '{' at Element.inline (ganja.js:1852:136) at <anonymous>:10:18
Demo: https://enki.ws/ganja.js/examples/coffeeshop.html#NG7DYcbaq
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Not everyone knows this function-in-object-shorthand trick (known as an ObjectMethod in e.g. Babel AST), but I like it:
However, it doesn't work right now. A workaround for the
inline
function:Currently it just fails:
Demo: https://enki.ws/ganja.js/examples/coffeeshop.html#NG7DYcbaq
The text was updated successfully, but these errors were encountered: