{"ScriptPreparationCode":null,"TestCases":[{"Name":"matchMedia \u002B addListener","Code":"const matchMedia = window.matchMedia(\u0022(min-width: 400px)\u0022);\r\n\r\nmatchMedia.addListener((query) =\u003E {\r\n if (query.matches) {\r\n console.log(true); \r\n }\r\n})\r\n","IsDeferred":false},{"Name":"resize \u002B innerWidth","Code":"let currentWidth = window.innerWidth;\r\n\r\nfunction debounce(func){\r\n var timer;\r\n return function(event){\r\n if(timer) clearTimeout(timer);\r\n timer = setTimeout(func,100,event);\r\n };\r\n}\r\n\r\nwindow.addEventListener(\u0022resize\u0022,debounce(function(e){\r\n currentWidth = window.innerWidth;\r\n}));\r\n\r\nif (currentWidth \u003E 400) {\r\n console.log(true); \r\n}","IsDeferred":false}]}