I came across a code that look like this:
const tempFunc = exp => {
return new Function(`return ${exp}`)()
}
first question: is it self invoking the function and return it?. what does tempFunc return exactly?
second question: if we call the function:
let result=tempFunc('3+2')
the result is 5.how does it convert the string and calculate the result?