Currently, I am working on a JavaScript code that will allow users to provide star ratings for specific articles through a widget. One of the requirements is to first verify if the Rating feature is enabled for a particular SharePoint list. If it is enabled, then the code related to rating should be executed.
I understand that one way to achieve this is by checking if the Rating and AverageRating columns exist in the list. However, I would prefer not to rely solely on this method as there could be cases where these columns were manually created by the user while the Rating setting remains disabled.
If anyone has a sample JavaScript code that addresses this issue, please share it with me.