what is a pure function in javascript?

a pure function is a JavaScript function that, given the same input, will always return the same output and have no side effects. This means that the function does not modify any external state or data, and its output is solely determined by its input. Pure functions are considered to be more predictable and easier to test and reason about, which is why they are often used in functional programming and when working with immutable data.

Or we can understand in one line..

"A function is pure when it returns the same result for the same input props"