I know that pure functions are in the "functional programming" paradigm, you create a function that doesn't have any side effects and that for a input it always return the same output like:
function (a,b) {
return a + b;
}
This is a pure function because for a input I always return the same output and I didn't create any side effects. Ok I got that.
But how can I make "pure functions", how can I stay in the "functional programming" paradigm when I actually want to create a side effect, such as changing a text content in the DOM, like :
function changeContent () {
let content = document.querySelector("#content");
content.textContent = 'Hello World';
}
This function has a side effect, it is not getting a input a return a output, it is creating a side effect, but that is actually the point of the function. Is this still "functional programming"? How to stay in the "functional programming" paradigm in that case?