This information is only valid when you use classic SharePoint experiences in SharePoint Online or in on-premises. Usage of classic SharePoint JavaScript Client Object Model is not supported with the ...
Use the SharePoint Cross Domain JavaScript library to access SharePoint data from a remotely hosted web page without the need for OAuth tokens. SharePoint add-in model is considered as a legacy option ...