Skip to content
Sign upLog in
How to remove item from list
Profile icon
MatthewX

How do you remove a item from a list in js? Like a = "somenumberinlist" and then remove a from the list.

You are viewing a single comment. View All
Profile icon
Coder100

@MatthewX

function generate(arr) { return arr[Math.floor(Math.random() * arr.length)] } arr.splice(generate(arr), 1)