Es6 functions, simple question from beginner

Es6 functions, simple question from beginner
0

#1

Hi guys. I have a very simple question for someone, but Im confused with it.
Dont understand the logic, why do we need to use a func inside another func and call it from the inside ? What are the benefits ?

const increment = (function() {
“use strict”;
return function increment(number, value) {
return number + value;
};
})();


#2

Do you need a function inside a function. For most cases, no. I only put a function inside a function if I’m planning to return a function as a result of certain conditions being met.