4 ms·
Very cool indeed. I would implement it as a React component - and then in any view just have to <Javascript> [1,2,3].map((n) => (n+1)) </Javascri
by hkjgkjy 10y ago
Very cool indeed. I would implement it as a React component - and then in any view just have to
<Javascript>
[1,2,3].map((n) => (n+1))
</Javascript>
But the of course requires you to implement the page using react, which isn't what everyone is doing.
- colordrops 10y agoCould use web components, which are supported in some browsers, and can be polyfilled in others.
- phpnode 10y agoI think you'd run into escaping issues like that. It would have to be: <JavaScript src={`[1, 2, 3].map(n => n + 1)`} />