The Library Bookmarks · Notes · Snippets

← Back to the front page Filed

Comparing JavaScript functions, i.e., “Is () ⇒ {} === () ⇒ {}?”

javascript

Most code goes through uglification/minification for production. To compare two functions as being the same you need to compare the actual content of the functions—for example, Function.toString() === Function.toString() will work despite an uglification process, becuase the .toString() function will return their contents and evaluate those

■