How to hide buttons based on their icons instead of indices?

Hello @community...!
I am using index number for hiding buttons in list or library control with help of this article.
But as plumsail forms are updating frequently I need to know another stable way to hide this button by there icon.
Please let me know how can I hide the button based on their icon?

Thanks in Advance.

Hello @harshp924,

Please see the code example that hides the upload button from the List or Library control by its icon:

fd.control('SPDataTable1').buttons.forEach(function(button){
    if(button.icon == "Upload") {
        button.visible = false
    }
});