I needed a graphing calculator that plots sin(2x) + x^2 while you type. The obvious implementation is one line: const y = eval ( expression .