Javascript puzzle - seal the secret

Jan Küster - Apr 8 '22 - - Dev Community

Write a function seal that receives an input String str and "saves" the string.

When passing the exact String again it should return true, while passing any other argument it should return false.

seal(str) // saved
seal(str) // true
seal(otherStr) // false
Enter fullscreen mode Exit fullscreen mode

Conditions:

The string should not be revealed when printing the function or any of it's properties via toString.

Beginners:

  • use any technique you like

Advanced:

  • the function should be self-contained and independent from any externals

Note:

  • don't expect a solution to be something usable for a production environment
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player