12345678910111213141516171819202122 |
- <header>
- <h1>Multiply table slice</h1>
- </header>
- <body>
- <script>
- arr = [];
- for (let i = 1; i <= 5; i++) {
- arr[i] = [];
- for (let j = 1; j <= 5; j++) {
- arr[i][j] = i * j;
- }
- }
- arr = arr.slice(1)
- for (let i = 0; i < 5; i++) {
- arr[i] = arr[i].slice(1);
- }
- alert(arr);
- </script>
- </body>
|