function bookRentData(bookData) { bookData.forEach((book) => { //generate random sku number const sku = book.sku var random = sku[Math.floor(Math.random() * sku.length - 1)]; document.getElementById("message").innerHTML = sku[random]; }); wrap.innerHTML += `<tr> <td>${book.sku}</td> <td>${book.price}</td> </tr>` }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter