Delete list using javascript

Hi there, I have a list pulled from data resource into a page variable. How can i delete a list using the javascript in the app. I tried this code but unfortunately its not working. Could someone help me on this , it will be a big help TIA

for the update i used this code and this appears in the console


I don’t think you are able to change it inside the javascript but you can send that filtered data to the output and use that output on one set page variable.