Home > Article > Web Front-end > js The shortest IE browser judgment code in the world_javascript skills
var ie = ! "v1";
Only 7bytes required! See this article, "32 bytes, ehr ... 9, ehr ... 7!!! to know if your browser is IE", which tells how foreigners change the judgment of IE from 32 bytes The story of reducing it to 7 bytes step by step
But this record was broken by a Russian on January 8 this year, and now it only has 6 bytes! It uses the toString method of IE and standard browsers in processing arrays made of differences. For standard browsers, if the last character in the array is a comma, the JS engine will automatically remove it. See details here Congratulations, Aleko, you are truly my idol!
var ie = !-[1,];