From 770abe173d5bef1ff0d1f7432d458ec3bbb68f81 Mon Sep 17 00:00:00 2001 From: Ibrahim Islam Date: Sun, 9 Sep 2018 00:31:11 +0700 Subject: [PATCH] fixes code issue to make the example working `Cannot read property 'name' of undefined` error will not be given until in strict mode --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e21ef2..5c5bc6b 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,8 @@ Often times we have nested functions in which we would like to preserve the context of `this` from its lexical scope. An example is shown below: ```javascript +'use strict'; + function Person(name) { this.name = name; } @@ -1220,4 +1222,4 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -[(back to table of contents)](#table-of-contents) \ No newline at end of file +[(back to table of contents)](#table-of-contents)