Referential transparency in functional programming
问题 I am new to JS and was learning functional programming and came across the term "referential transparency". Also, I found this statement "Referential transparency says it's safe to replace a pure function with its value". Does it mean that the use of RT makes it easy for JIT compiler to replace function with its return value as long as function gets hot? Is that true? 回答1: Here's an example: This is a pure function: it will always return the same output for the same input const even = x => x