diff --git a/content/lessons/js2/sublesson/map_reduce_and_filter_functions.mdx b/content/lessons/js2/sublesson/map_reduce_and_filter_functions.mdx index 26182c3c3..1703aec5d 100644 --- a/content/lessons/js2/sublesson/map_reduce_and_filter_functions.mdx +++ b/content/lessons/js2/sublesson/map_reduce_and_filter_functions.mdx @@ -1406,7 +1406,8 @@ When the function is running, `this` refers to the object that comes before `.`. ```jsx Array.prototype.last = function () { return this[this.length - 1] -}[(1, 2, 3)].last() // When the last function is run, 'this' refers to [1,2,3] +}; +[1, 2, 3].last() // When the last function is run, 'this' refers to [1,2,3] const jackfruit = [1, 2, 3].last() // What is jackfruit? ``` @@ -1415,7 +1416,8 @@ const jackfruit = [1, 2, 3].last() // What is jackfruit? ```jsx Array.prototype.last = function () { return this[this.length - 1] -}[(1, 2, 3)].last() // When the last function is run, this refers to [1,2,3] +}; +[1, 2, 3].last() // When the last function is run, this refers to [1,2,3] jackfruit = [1, 2, 3].last() // 3 ```