JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div id="log"></div>
</body>
JavaScript
var userAgent = navigator.userAgent;
var splitted = userAgent.match(/[(][^)]+[)]|\w+\/\S+/ig);
var outputDiv = document.getElementById("log");
for (var i = 0; i < splitted.length; i++ ) {
var str = splitted[i];
if (str[0] == '(') {
} else {
var name = str.match(/[^\/]+/i);
var version = str.match(/[0-9|\.]+/i);
outputDiv.innerHTML += name.toString() + " is a " + typeof(name) + "<br><br>";
outputDiv.innerHTML += version.toString() + " is a " + typeof(version) + "<br><br>";
}
};