react 작업중에 pc 일때와 mobile 일때 정렬이 다를 때가 있어서 찾아보다가 발견함.
console.log("=======navigator.userAgent========\n", navigator.userAgent, typeof navigator.userAgent, /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
if (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())) {
어쩌고 저쩌고
}
확실히 .toLowerCase() 방식이 편한듯..
'개발일지' 카테고리의 다른 글
Nestjs test할때 src/**/ 어쩌구 절대경로 오류 해결법 (1) | 2020.12.18 |
---|---|
postgresql JOIN 간단 예시 - 자꾸 잊어버려서 적어두는... (0) | 2020.06.19 |
toastify notification이 스크린 밖에서 뜰때 (0) | 2020.06.05 |
vertically , horizontally align center in React (0) | 2020.06.02 |
localStorage vs sessionStorage (0) | 2020.05.28 |