diff --git a/README.md b/README.md index b203a060..33f3499c 100644 --- a/README.md +++ b/README.md @@ -1205,6 +1205,16 @@ The `catch` block receives the argument `x`. This is not the same `x` as the var Later, we set this block-scoped variable equal to `1`, and set the value of the variable `y`. Now, we log the block-scoped variable `x`, which is equal to `1`. Outside of the `catch` block, `x` is still `undefined`, and `y` is `2`. When we want to `console.log(x)` outside of the `catch` block, it returns `undefined`, and `y` returns `2`. +
+let x; // Outer x
+try {
+  throw new Error();
+} catch (x) { // Inner x, shadows outer x
+  x = 1; // Inner x is set to 1
+  // The outer x is still undefined
+}	
+
+