간단 정리
    	const type = (target,type)=>{
    		if(typeof type == "string"){
    			if(typeof target != type) throw `invalid type ${target} : ${type}`;
    		}
    		else if(!(target instanceof type)) throw `invalid type ${target} : ${type}`;
    		return target;
    	}
    	const test = (arr, _ = type(arr,Array))=>{
    		console.log(arr);
    		console.log(_);
    	}
    	// test([1,2,3]);
    	const test2 = (a,b,c,_0=type(a,"string"),_1=type(b,"number"),_2 = type(c,"boolean"))=>{
    		console.log(a,b,c);
    	}
    	test2("abc",123,true);
test2는 매개변수 6개를 받지만 실제 받는것은 3개이고 나머지 매개변수를 받지않는 것들은 해당
=에 따라서_0,_1,_2해당 내용을 확인 할 수 있다 이때 type함수가 작동되면서 문제가 발생하면 이를 실행하지않고 오류를 발생시킨다.
Author And Source
이 문제에 관하여(간단 정리), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@khw970421/간단-정리저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)