It so happens that I currently have alerts with SweetAlert itself, which works perfectly.
The question:
Is it better to handle this type of alerts with pure JS (VanillaJS) or other libraries talking about performance?
This question arises because there are sites where they handle too much information and always use the typical JS alerts, as is the case with this SO site
Example of the two alerts:
function alertaJs(){
alert('Alerta con JavaScript');
}
function alertaSweet(){
swal('Alerta con SweetAlert Js');
}
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<button onclick="alertaJs();">Alerta JavaScript</button><br>
<button onclick="alertaSweet();">Alerta SweetAlert</button><br>
Very independent of how "beautiful" the alerts can be seen, there must be a logical reason to use these libraries or not, thanks in advance.
From experience I can't find a technical reason not to use alternative methods.
Now, if you want to use the standard alert, you must take into account that it stops the execution thread and if that is not your purpose, it is better to use console.log.
On the other hand, if what you want is to stop the execution for debugging or another reason, there is nothing wrong with using an alert or as long as the execution pause does not affect your code.
I give you an example where you can see how the alert stops the execution and on the other hand the library that you have presented does not (the time that is seen is only what it takes to process the task but it does not stop the execution since the console.log comes out the same even if you don't close the message).