The expression [][[]]
evaluates to undefined
in JavaScript. My understanding of this was that the compiler sees the second set of [...]
and interprets that to be an array subscript operator (because you can’t have two arrays next to each other).
So the compiler knows that the inner expression, []
, must be an index, and so after evaluating it, it coerces it to a number. Number([])
evaluates to 0
, and so we have [][0]
, which is undefined
.
However, [1][[]]
does not evaluate to 1
as I would expect, but rather to undefined
suggesting that in this case (or maybe also in the previous case), []
isn’t being coerced to a number. It seems that I must use the unary +
to force the type coercion:
[1][+[]] // returns 1
So if the inner []
in the expression [][[]]
is not being coerced to a number, then why does that expression evaluate to undefined
?
amoxicillin for sale in usa without px – buy amoxicilin 500 mg online mexico amoxicilin brand name
price generic viagra – viagra coupon online viagra 25 mg tablet buy online
cialis super active – tadalafil medicine in india cialis 5mg best price australia
generic clomid 100mg online – clomiphene tablets clomiphene generic
cheap generic viagra canadian pharmacy – viagra pills 150mg viagra soft sale
generic cialis cheap – generic cialis next day shipping cialis no prescription
best online casino – empire city casino online jackpot party casino
prednisone 20 mg price india – prednisone 500 mg tablet prednisone 20 mg in india
viagra online japan – viagra Houston sildenafil 100 mg tablet coupon
buy methylprednisolone online – lyrica 50 mg price buy lyrica medication
ventolin price uk – ventoingo.com buy Albuterol
978244 271866I enjoyed reading your pleasant site. I see you offer priceless info. stumbled into this site by chance but Im certain glad I clicked on that link. You surely answered all the questions Ive been dying to answer for some time now. Will undoubtedly come back for far more of this. 702552
roaccutane without a prescription – accutane generic cost buy accutane
buy generic cialis 5mg – Cialis samples buy cialis wholesale
buy accutane online paypal – buy accutane 5mg accutane mexico
ivermectin 1 cream – purchase oral stromectol ivermectin cream
buy generic plaquenil – plaquenil 400mg for sale valacyclovir uk
sildalis for sale online – order propecia sale cost glucophage 1000mg
buy acillin pill – order ciprofloxacin 1000mg online cheap plaquenil 200mg pills
order plaquenil 200mg online cheap – plaquenil 400mg ca purchase hydroxychloroquine generic
order viagra 100mg online – order viagra sale buy generic tadalafil 20mg
sildenafil 50mg generique en pharmacie – acheter 10mg tadalafil en ligne cialis en france
stromectol cream – stromectol 6mg price ivermectin 15 mg
order prednisone 5mg online – cheap erectile dysfunction order prednisone 20mg pill
orlistat online order – orlistat 60mg cheap plaquenil 200mg tablet
inderal 10mg for sale – hydroxychloroquine sale plaquenil 400mg us
caesars casino online – azithromycin us order azithromycin 250mg generic
727879 920694You produced some decent points there. I looked on the internet for that problem and located most individuals goes along with along with your internet website. 416228