/* In Javascript the same thing can be done using array.splice() method */ const items = [1, 2, 3, 4, 5, 6, 7]; console.log(items, "Items before splice"); items.splice(3, 0, 50); console.log(items, "Items After splice");
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