How does -Infinity actually work?

NiCk Newman
    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.

James Donnelly

-Infinity숫자 값입니다. 숫자 값에는 .length속성이 없으므로 읽기를 시도하면을 반환 undefined합니다. turkeycheck변수 자체에 보유 된 값 은 변경되지 않고 그대로 유지되며 길이를 기록한 후 해당 값을 기록하려고하면 값이 계속 표시 -Infinity됩니다.

var n = 1;
console.log(n.length); // undefined
console.log(n);        // 1

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How does ForkJoinPool#awaitQuiescence actually work?

분류에서Dev

How does COBOL actually accept numeric values?

분류에서Dev

Why and how does this work?

분류에서Dev

How does this work in javascript

분류에서Dev

endturnwithnextparticipants, how does it work?

분류에서Dev

How does SimpleCORSFilter work?

분류에서Dev

Phonegap how does it work?

분류에서Dev

How does collect static work?

분류에서Dev

How does "newElements" work in Javascript?

분류에서Dev

How does scanr work? Haskell

분류에서Dev

how does readyRead() work in Qt?

분류에서Dev

How does this pointer typecasting work?

분류에서Dev

How does shared hosting work?

분류에서Dev

How does ServiceNameQuery work in AngularJS

분류에서Dev

How does the INTERVAL datatype work?

분류에서Dev

How does file compression work?

분류에서Dev

How does Windows API work?

분류에서Dev

how does int*& variableName work ?

분류에서Dev

How does 'telnet localhost' work?

분류에서Dev

What does yum actually do?

분류에서Dev

What does yum actually do?

분류에서Dev

How does Linux differentiate between opening a file in read mode and actually reading data from it?

분류에서Dev

How to assign -INFINITY amongst others to multiple variables?

분류에서Dev

How does return work for a function local variable?

분류에서Dev

How does * to access pointers of variables or arrays work?

분류에서Dev

How does Xojo UI rendering for desktop work?

분류에서Dev

How does this implementation of array intersection work?

분류에서Dev

How does Gradient.Evaluate work internally?

분류에서Dev

How Does Initalizing a Javascript Modal Work in Materializecss?