Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Svelte is the most beautiful web framework I've seen. Parent comment
Paste this and run:
<script> const rows = 100, cols = 10, table = Array.from({ length: rows }).map((_, i) => Array.from({ length: cols }).map((_, j) => ({ i, j }))); console.log(table); setInterval(function() { let cell = table[Math.floor(Math.random() * rows)][Math.floor(Math.random() * cols)]; cell.i = Math.floor(Math.random() * 100); cell.j = Math.floor(Math.random() * 100); }, 1); </script> <table> <tr for="let row of table"> <td for="let cell of row" bind>cell.i + ":" + cell.j</td> <td></td> </tr> </table>
There are no comments on this comment yet.
Paste this and run:
It only updates DOM element textContent on each change.