It will likely surprise many to learn that Edge's UA string identifies itself as everything but IE with "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136" (namely Firefox and derivatives, iOS's massively flawed WebKit, Chrome, Safari and Edge). IE11's UA string identifies it as Firefox and "Trident" (a proprietary Microsoft browser scheme -- MSHTML). IE used to introduce itself as Mosaic if I recall correctly
Using the UA string alone would require that you isolate the presence of "Edge" before you scan for other UA IDs. The UA string will tell you if they're using Edge, but if you aren't careful, it will look like all the other browsers (Opera advertises as Chrome because it is mostly Chrome with lipstick).
What a browser advertises as must be very carefully parsed as Microsoft isn't particularly hesitant to advertise general capabilities that their products may or may not have. In terms of actual capabilities, there's another system that is used to try calling the function using javascript. If the test call fails, the feature isn't implemented.