You can achieve this by using a loop to iterate over an array of numbers, and use the modulus operator to check if the current index is a multiple of 7.
index.tsx176 chars8 lines
In the above code, i % 7
checks if the current index is divisible by 7 without leaving any remainder. If it is divisible, then the current element of the array at that index is printed out using console.log()
.
gistlibby LogSnag