Showing a dialog box or writing text to the screen is a side effect. A lot of functions are useful because of the side effects they produce. Functions may also produce values, and in that case, they don’t need to have a side
effect to be useful. For example, the builtin function
Math.max takes any number of number values and gives back the greatest.
console.log(Math.max(2 , 4));