Как сделать что бы запускалась функция при определённом разрешение 
let navHover = document.querySelector(".nav_hover");
let navListDescop = document.querySelector(".navig:nth-child(10)");
let navListPhone = document.querySelector(".navig:nth-child(2)");
let descop = document.querySelector(".navig:nth-child(10)");
let phone =document.querySelector(".navig:nth-child(2)");
navHover.onmouseover = navOn;
navHover.onmouseout = navOff;
navListDescop.onmouseover = navListOn;
navListDescop.onmouseout = navListOff;
function navOn(){
	descop.style.top = "320px";
}
function navOff(){
	descop.style.top = "-360px";
}
function navListOn(){
	descop.style.top = "320px";
}
function navListOff(){
	descop.style.top = "-360px";
}
function test(){
	if (document.documentElement.clientWidth > 860) {
		navHover.onmouseover = navOn2;
		navHover.onmouseout = navOff2;
		navListPhone.onmouseover = navListOn2;
		navListPhone.onmouseout = navListOff2;
		function navOn2(){
			phone.style.marginTop = "0px";
		}
		function navOff2(){
			phone.style.marginTop = "-1500px";
		}
		function navListOn2(){
			phone.style.marginTop = "0px";
		}
		function navListOff2(){
			phone.style.marginTop = "-1500px";
		}
	}
}
test();
особенность  в том navHover это один и тот же блок