JXA: How do I use Finder to trash a file?

This seems to -- though I don't pretend to understand how or why!

const path = Path("/path/to/file/toDelete.txt");
const finder = Application("Finder");
finder.delete(path);
1 Like