How can []+(-~{}-~{}-~{}-~{})+(-~{}-~{}) be equals to "42" in javascript?
Sorry for the title, but it can make it easier for other people to find the post. (I saw it mentioned in a forum)
Solved :
[] will convert the expression to a String.
-~{} = -1
So
-~{}-~{}-~{}-~{} = 4
-~{}-~{} = 2
The rest is String concatenation