+2

Please i don't know why the "this" variable didn't reffered to the "arr" variable. I need explanation

https://code.sololearn.com/WID5BSudKqc1/?ref=app

2/14/2020 10:10:08 PM

JAM

3 Answers

New Answer

+6

You are using an arrow function. With arrow functions the this keyword always represents the object that defined the arrow function. In this it is the window object. https://www.w3schools.com/js/js_arrow_function.asp Edit: I would also suggest using the spread operator when passing this to Math.max() https://www.sololearn.com/learn/JavaScript/2978/

+2

ODLNT thanks very much for the explanation 😊

0

No problems JAM, I'm glad I was able to help.