Can I use a View in my JS code, by adding the View's shortcode where the JS expects some results? The View returns the results the code expects.
Generally, ShortCodes can not be added to JS.
You could add the JS within script tags to your HTML section of a content Template for example.
Then you could apply this custom code here to retrieve a "raw" Views' loop result. This can then eventually be used to populate your Custom JS.
This is however not suggetsed, n or supported. It is a full custom solution - and not agreeing with Toolset Views' major purpose, which is to display - not deliver data.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.