how to find device type in javascript code example Example: javascript get device window.navigator.userAgent