Javascript examples for Array:slice
array mapping with array slice
<html> <head> <meta name="viewport" content="width=device-width"> </head> <body> <script> const array = [{name:'A'},{name:'B'},{name:'C'},{name:'D'},{name:'E'},{name:'F'},{name:'G'},{name:'H'},{name:'I'}]; let i = 0//from www .j av a 2 s . com setInterval(() => { console.log(array.slice(i,i+3)) i*3 > array.length ? i=0 : i += 3 }, 3000) </script> </body> </html>