Array to If
Node.js module that generates a function with сonditional branches over a given array
Install
npm i array_to_if
Example
const F = require('array_to_if')
let foo = eval(F([1,2,3,4,5], 'if (argv[0] == %%) { return argv[0]*%% } else', 0))
console.log(foo(3))