Greetings, I’m a bit stuck wrapping my head around the concept of scope. One example shows the following const multiplier as global, but in another example, it shows it as block scope.
*in this example i see 3 global variables, input, controlVal and multiplier. What about number and phase parameter? are they global in scope also?
*in this example it shows number, phase and const val as block. What happens if one does not declare with const or let inside the block? What scope is that?
const input = 8;
const controlVal = input / 2 + 3;
const multiplier = (number, phase) => {
const val = number * controlVal + phase;
console.log(val);
};