STACKOVERFLOW = [];
turkeycheck = Math.max.apply(null, STACKOVERFLOW);
if(!turkeycheck){
// See Below
}
console.log(turkeycheck);
console.log(turkeycheck.length);
Can also be visible here: http://jsfiddle.net/L4zgfcmz/5/
Just curious why (!turkey)
doesn't get catched but using turkeycheck.length
shows it's undefined? If it's undefined doesn't that mean it's false?
Also, if turkey
is console logging -Infinity
, shouldn't the length of turkeycheck
become 11?
I'm just confused as why the turkey
is being set to '-Infinity', but then becomes undefined
.
-Infinity
숫자 값입니다. 숫자 값에는 .length
속성이 없으므로 읽기를 시도하면을 반환 undefined
합니다. turkeycheck
변수 자체에 보유 된 값 은 변경되지 않고 그대로 유지되며 길이를 기록한 후 해당 값을 기록하려고하면 값이 계속 표시 -Infinity
됩니다.
var n = 1;
console.log(n.length); // undefined
console.log(n); // 1
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다