Note - The "use strict"; expression can only be placed as the first statement in a script or in a function.
Let's see the example without using strict mode.
Here, we didn't provide the type of variable. Still we are getting an output.
Let's see the same example by enabling the strict mode.
Now, it will throw an error as the type of x is not defined.
Let's see one more example to print sum of two numbers.
Here, an error occurs as we use duplicate elements.