Question #2

Author: admin
tags: JavaScript  
const func1 = (x) => x * 2;

const func2 = (x) => {
  x = x * 3;
  x = x + 1;
}

const y = func1(5);
const z = func2(2);

console.log(y + z); // ??
What will the console output be?
2
5
10
17
107
undefined
NaN
The console will not output anything, there will be an error.
The second arrow function has more than one expression written in it, so it uses a syntax with curly brackets. To return a value, there must be a return, but it is missing.
A function that does not have a return always automatically returns undefined.
It turned out: 10 + undefined, which was eventually calculated in NaN.
Rate the difficulty of the question:
easyhard