Javascript ++ [[]] [+ []] + [+ []] === "10"

This is not a very serious question, but I think it can help me understand another aspect of Javascript.

Some time ago I found this strange code:

<script>
if( ++[[]][+[]]+[+[]] === "10" )
    alert( ':o');
</script>

In fact true!

Do any of you know why?

+4
source share

All Articles