Hi Tomaso,
There's no syntax error here; this line simply invokes a function named "hoMethod3". If no such function exists when the line is executed, the script engine generates a runtime error. It may be semantically incorrect, but this line is 100% legal JavaScript, and because JavaScript has no static typing, the engine can't detect this kind of error prior to execution.
As in the first example, the line is legal JavaScript, so the error would not be detected until runtime.
Cheers!
hoMethod3("Three"); // the "dot" is missing - real syntax error
There's no syntax error here; this line simply invokes a function named "hoMethod3". If no such function exists when the line is executed, the script engine generates a runtime error. It may be semantically incorrect, but this line is 100% legal JavaScript, and because JavaScript has no static typing, the engine can't detect this kind of error prior to execution.
Does it recognize that Method34 doesn't exist before starting the execution or when the 3-rd line is processed??
As in the first example, the line is legal JavaScript, so the error would not be detected until runtime.
Cheers!