DEV Community

Discussion on: Anagrams Checker - Three JavaScript Solutions

Collapse
 
moopet profile image
Ben Sinclair

I think that function expressions using ! are there just to make the code less readable.

Collapse
 
calebpitan profile image
Caleb Adepitan • Edited

My bad! I won't lie to you I really don't know the use of the "!", but I think it's to indicate an iife inside the function, hence aid readability. I put it because in my early years I saw a lot of these around, and I thought having it around or not affects nothing. Didn't know it affects readability, although I don't understand how. I wouldn't mind if you told me.

Thread Thread
 
moopet profile image
Ben Sinclair

I prefer explicit to implicit (comes from enjoying Python too much...) and !(function(){...}(); is just... well, if you haven't seen it before you have no idea what the gosh darnit is going on.

Thread Thread
 
calebpitan profile image
Caleb Adepitan