Message from JavaScript discussions

November 2020

— Random pool generator toy:


a = if operator == '<'
then a < b
else if operator == '>'
then a > b
else a == b
#livescript pseudocode

— Thanks for your response. Could you please explain how it works?

— It works straight away.. ternary, switch or ifs, you decide

— This is my current solution

— Why you need Operators.blabla

— Too many entry points will weaken the fortress

— It is a filter function where it accepts
valueInArray to compare
Operand - how to compare // ==, <, > etc
Value to compare with.

Message permanent page

— So you do
[{a: 2}, {a: 3}, {a:4}].filter('a', 'gt', 3);
the return is: [{a:4}]

— Don't over-engineer things, or you'll fall into random trap🤤

— This can then be used for much complex objects

— That example is way too synthetic