Javascript Libraries vs REST API - performance

Is there any performance advantage in using Javascript libraries compared to REST API?

I am using from Ionic Mobile app.

Thanks

The JS library uses REST API, therefore performance of the library vs. raw REST would be about the same.