Coolest JS quirk utilisation I’ve recently seen

Check out JS multiline strings:

Do you wander how it’s done? Open your JS console (Chrome: ctrl+shift+i) and type:

f = function(){/* my multiline 
string */}
(f + "").substring(14).slice(0, -3)

and you’ll get

" my multiline 
string "

This is really creative. +1

Share Button

Leave a Reply

Your email address will not be published. Required fields are marked *